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 printDivisors(n) : 
    i = 1
    factors=set()
    while i <= math.sqrt(n): 
        if (n % i == 0) : 
            if (n / i == i) : 
                factors.add(i) 
            else :
                factors.add(i)
                factors.add(n//i)
        i = i + 1
    return factors
    
def isPerfectSquare(n) : 
    i = 1
    while(i * i<= n): 
        if ((n % i == 0) and (n / i == i)): 
            return True
        i = i + 1
    return False
        
arr=list(map(int,input().split()))
arr.sort()
if(arr[0]==arr[1] and arr[1]==arr[2] and arr[0]==arr[2] and isPerfectSquare(arr[0])):
    side=(int(math.sqrt(arr[0])))
    print(side*12)
else:
    factors_1=printDivisors(arr[0])
    factors_2=printDivisors(arr[2])
    comman=list(factors_1&factors_2)
    side1=max(comman)
    side2=arr[0]//side1
    side3=arr[2]//side1
    print(4*(side1+side2+side3))