Given the number *n*, find the smallest positive integer which has exactly *n* divisors. It is guaranteed that for the given *n* the answer will not exceed 10<sup class="upper-index">18</sup>.
The first line of the input contains integer *n* (1 ≤ *n* ≤ 1000).
# Author : Ghulam Junaid

def is_prime(n):
    for i in range(int(n**0.5),1,-1):
        if n%i==0:
            return False
    return True

primes = []
for i in range(2,998):
    if is_prime(i)==True:
        primes.append(i)

n = int(input())

if is_prime(n)==True:
    print(2**(n-1))

else:
    p_divs = []
    for i in primes:
        if n%i==0:
            imp = n
            pows = 0
            while imp%i==0:
                pows+=1
                imp = imp//i
            p_divs.append([i,pows])
        if i>(n//2):
            break
    output = 1
    count = 0
    for i in range(len(p_divs)-1,-1,-1):
        for j in range(p_divs[i][1]):
            imp2 = primes[count]
            output *= imp2**(p_divs[i][0]-1)
            count += 1
    print(output)
