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 inp():  # int inputs
    return (int(input()))


def inlt():  # list inputs
    return (list(map(int, input().split())))


def insr():  # string inputs
    s = input()
    return (list(s[:len(s)]))


def invr():  # space sepreated intergel varibales
    return (map(int, input().split()))

def is_prime(number):
    if number <= 1:
        return False
    elif number <= 3:
        return True
    elif number % 2 == 0 or number % 3 == 0:
        return False
    i = 5
    while i * i <= number:
        if number % i == 0 or number % (i + 2) == 0:
            return False
        i += 6
    return True

def binary_search(arr, target):
    left = 0
    right = len(arr) - 1

    while left <= right:
        mid = (left + right) // 2

        if arr[mid] == target:
            return mid
        elif arr[mid] < target:
            left = mid + 1
        else:
            right = mid - 1

    return -1


def generate_permutations(input_list):
    if len(input_list) == 1:
        return [input_list]

    all_permutations = []
    for i in range(len(input_list)):
        first_element = input_list[i]
        remaining_elements = input_list[:i] + input_list[i + 1:]
        remaining_permutations = generate_permutations(remaining_elements)

        for permutation in remaining_permutations:
            all_permutations.append([first_element] + permutation)

    return all_permutations



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




curr = inlt()
first = curr[0]
second = curr[1]
third = curr[2]

factors = get_common_factors(first, second)

possibilities = []


for b in factors:
    a = second / b
    c = first / b

    if (int(a) == a and int(c) == c and a*b == second and a*c == third and b*c == first):
        print(4 * (a+b+c))