def greatest_common_divisor(value1: int, value2: int):
    """Calcula o maior divisor comum de dois valores"""

    value1 = abs(value1)
    value2 = abs(value2)

    if value1 < value2:
        value1, value2 = value2, value1
    
    remainder = value1 % value2

    if remainder == 0:
        return value2
    
    return greatest_common_divisor(value2, remainder)