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.
#!/usr/bin/env python
# coding: utf-8

# In[204]:


# # n = int(input())
# # line = list(map(int, input().split()))
# # line = list(str(input()))


# In[71]:


def cf(a, b):
    commons = []
    for i in range(1, min(a, b) + 1):
        if a%i == 0 and b%i == 0:
            commons.append(i)
    return commons


# In[87]:


three_areas = list(map(int, input().split()))


# In[88]:


a_x, a_y, a_z = three_areas[0], three_areas[1], three_areas[2]

comp_1 = cf(a_x ,a_y)
comp_2 = cf(a_x, a_z)
# comp_3 = cf(a_y, a_z)


# In[92]:


for i in comp_1:
    for j in comp_2:
        if i*j == a_x:
            edge_x = i
            edge_y = j

if a_y/edge_x == a_z/edge_x:
    edge_z = int(a_y/edge_x)


# In[91]:


circum = (edge_x * 4) + (edge_y * 4) + (edge_z * 4)
print(circum)

