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.
abc = [int(abc) for abc in input().split()][:3]
a = []
b = []
c = []
for i in range(len(abc)):
     for j in range(2,abc[i]//2 + 1):
          if abc[i] % j == 0:
               if i == 0:
                    a.append(j)
               if i == 1:
                    b.append(j)
               if i == 2:
                    c.append(j)

a = set(a)
b = set(b)
c = set(c)

def perimeter(a,b,c):
     m = list(a.intersection(b))
     x = max(m)
     n = list(b.intersection(c))
     y = max(n)
     o = list(a.intersection(c))
     z = max(o)
     return 4*(x+y+z)
print(perimeter(a, b, c))
