You've got a rectangular parallelepiped with integer edge lengths. You know the areas of its three faces that have a common vertex. Your task is to find the sum of lengths of all 12 edges of this parallelepiped.
The first and the single line contains three space-separated integers — the areas of the parallelepiped's faces. The area's values are positive ( &gt; 0) and do not exceed 10<sup class="upper-index">4</sup>. It is guaranteed that there exists at least one parallelepiped that satisfies the problem statement.
def gcd(a, b):
    def stein(a, b):
        if a == b:
            return a
        elif a % 2 == 0:
            return stein(a // 2, b)
        elif b % 2 == 0:
            return stein(b // 2, a)
        elif a >= b:
            return stein(((a - b) // 2), b)
        else:
            return stein(((b - a) // 2), a)
    a = abs(a)
    b = abs(b)
    if a < 1 or b < 1:
        return 1
    if a % 2 == 0 and b % 2 == 0:
        return 2 * stein(a // 2, b // 2)
    else:
        return stein(a, b)


a, b, c = sorted(list(map(int, input().strip().split())))

side1 = gcd(a, c)
side2 = max(a, c) // side1
side3 = min(a, c) // side1

print(2 * (side1 + side2) + 2 * (side2 + side3) + 2 * (side1 + side3))
