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).
from math import sqrt

def is_prime(num):
    if num < 2:
        return False
    for i in range(2, int(sqrt(num)) + 1):
        if num % i == 0:
            return False
    return True

def find_smallest_superprime(n):
    superprimes = []
    num = 2
    while len(superprimes) < 10:
        if is_prime(num):
            superprimes.append(num)
        num += 1
    
    dp = [[int(1e18 + 10) for _ in range(n + 1)] for _ in range(10)]
    
    for i in range(10):
        dp[i][1] = 1
        for j in range(2, n + 1):
            prime_power = 1
            for k in range(j):
                if j % (k + 1) == 0:
                    prime_power *= superprimes[i]
                    if i > 0:
                        dp[i][j] = min(dp[i][j], dp[i - 1][j // (k + 1)] * prime_power)
                    else:
                        dp[i][j] = prime_power
    
    return dp[9][n]

if __name__ == "__main__":
    n = int(input())
    result = find_smallest_superprime(n)
    print(result)

    	   		   	    		  	 		 		