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).
def fact(n):
    p = {}
    d = 2
    while d * d <= n:
        while n % d == 0:
            p[d-1] = p.get(d-1,0)+1
            n //= d
        d += 1
    if n > 1:
        p[n-1] = p.get(n-1,0) + 1
    return p

def isPrime(n):
    if n % 2 == 0:
        return n == 2
    d = 3
    while d * d <= n and n % d != 0:
        d += 2
    return d * d > n

m = int(input())
g = fact(m)
z = []
for i,j in g.items():
    z.extend([i]*j)
z.sort(reverse=True)
res = 1
pros = 2
for i in z :
    res *= pros**i 
    pros += 1
    while not isPrime(pros) :
        pros += 1
print(res)