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.
from itertools import product
from math import ceil

def binary_table(string_with_all_characters, length_to_make):
    return [''.join(x) for x in product(string_with_all_characters, repeat=length_to_make)]


def all_possible_substrings(string):
    return [string[i: j] for i in range(len(string)) for j in range(i + 1, len(string) + 1)]


def number_of_substrings(length):
    return int(length * (length + 1) / 2)


def is_prime(num):
    for i in range(2, num):
        if num / i == int(num / i) and num != i:
            return False

    return True


"""for enumeration in range(int(input())):
"""

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

num_pair = []
for num in nums[:1]:
    for i in range(1, num + 1):
        for j in range(i, num + 1):
            if i * j == num:
                num_pair.append([i, j])

for num in num_pair[1:]:
    a = num[0]
    b = num[1]
    c = nums[2] / b
    if c == int(c):
        print((a + b + c) * 4)
        break
    c = b / nums[2]
    if c == int(c):
        print((a + b + c) * 4)
        break

