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[61]:


# 20 10 50
# 9 4 36
# 1022 584 112
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[82]:


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


# In[83]:


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)


# In[88]:


potential_y_z = []
for i in comp_1:
    for j in comp_2:
        if i*j == a_x:
            potential_y_z.append([i, j])
        


# In[90]:


for edge_y_z in potential_y_z:
    edge_y = edge_y_z[0]
    edge_z = edge_y_z[1]
    
    if int(a_z/edge_y) == int(a_y/edge_z):
        edge_x = int(a_z/edge_y)
        break
    elif int(a_z/edge_z) == int(a_y/edge_y):
        edge_x = int(a_z/edge_z)
        break


# In[93]:


# print(comp_1, comp_2)
# print(a_x, a_y, a_z)
# print(edge_x, edge_y, edge_z)


# In[92]:


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


# In[ ]:




