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.
#import math
def ggt(a, b):
    while b != 0:
        c = a % b
        a, b = b, c
    return a

n, m, k = input().split()
n = int (n)
m = int (m)
k = int (k)
#n = int(input())
#m = int(input())
#s = input()
#t = input()
#h = list(map(int, input().split()))
#b = list(map(int, input().split()))
#c = list(map(int, input().split()))

#x1, y1, x2, y2 =map(int,input().split())
#n = int(input())
#f = []
#f = [0]*n
#t = [0]*n
#f = [(int(s1[0]),s1[1]), (int(s2[0]),s2[1]), (int(s3[0]), s3[1])]
#f = sorted (f, key = lambda tup: tup[0] )

#h = [""] * n
#f1 = sorted(f, key = lambda tup: tup[0])


#f1 = sorted(t, key = lambda tup: tup[0])
s1, s2, s3 = 0, 0, 0
if (n*m*k == 1):
    s1, s2, s3 = 4, 4, 4
elif(n == 1):
    s1, s2 = 4, 4
    s3 = m
elif(m == 1):
    s1, s2 = 4, 4
    s3 = k
elif(k == 1):
    s1, s2 = 4, 4
    s3 = 4*m
elif (n == m and m == k):
    s1, s2, s3 = 4*sqrt(n),  4*sqrt(n),  4*sqrt(n)
elif(n == k):
    s1 = 4 * sqrrt(m)
    s2, s3 = 4* n/sqrt(m),  4* n/sqrt(m)
elif(n == m):
    s1 = 4 * sqrrt(k)
    s2, s3 = 4* n/sqrt(k),  4* n/sqrt(k)
elif(m == k):
    s1 = 4 * sqrrt(n)
    s2, s3 = 4* m/sqrt(n),  4* m/sqrt(n)
else:
    for i in range(1, 1000):
        if (n % i == 0 and m % i == 0 and (n//i)*(m//i) == k):
            s1 = 4* i
            s2 = 4 *(n//i)
            s3 = 4 *(m//i)
            break;
            
print (s1+s2+s3)
