Problem:
Prime Factorization

Factorize a given integer n.

Input

n

An integer n is given in a line.

Output

Print the given integer n and :. Then, print prime factors in ascending order. If n is divisible by a prime factor several times, the prime factor should be printed according to the number of times. Print a space before each prime factor.

Constraints

2 ≤ n ≤ 109

Sample Input 1

12

Sample Output 1

12: 2 2 3

Sample Input 2

126

Sample Output 2

126: 2 3 3 7

Solution in Python3 (judge verdict: Wrong Answer)

def create_prime_list(limit):
    """ ??¨??????????????????????????§limit?????§????´???°?????????????±???????
    https://ja.wikipedia.org/wiki/%E3%82%A8%E3%83%A9%E3%83%88%E3%82%B9%E3%83%86%E3%83%8D%E3%82%B9%E3%81%AE%E7%AF%A9
    """
    x = limit**0.5
    primes = []
    # print('x={0}'.format(x))
    nums = [x for x in range(2, limit+1)]
    while nums[0] <= x:
        primes.append(nums[0])
        current_prime = nums[0]
        nums = [x for x in nums if x % current_prime != 0]
    primes.extend(nums)
    # print(primes)
    return primes



def calc_divisors(n):
    """ n????????????????????¨?????§????????°????????? """
    if n in Primes:
        return [n]
    results = []
    i = 2
    start_num = n
    while n > i**2:
        if n%i==0:
            while n%i==0:
                results.append(i)
                n //= i
            if n in Primes:
                results.append(n)
                n = 1
        i += 1
    #print('{0}????´???°: {1}'.format(start_num, results))
    if not results:
        results = [start_num]
    return results


Primes = set()
if __name__ == '__main__':
    # ??????????????\???
    target_number = int(input())
    # target_number = 999993031



    # ?¨?????????????
    Primes = set(create_prime_list(int(10**4.5)+1))
    results = calc_divisors(target_number)

    # ???????????¨???
    print('{0}: {1}'.format(target_number, ' '.join(map(str, results))))