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 find_primes(n):
    primes = []
    for i in range(2, int(sqrt(n)) + 1):
        if n % i == 0:
            return False
    return n > 1

def find_smallest_superprime(n):
    superprimes = []
    i = 2
    while len(superprimes) < 10:
        if find_primes(i):
            superprimes.append(i)
        i += 1
    
    dp = [[int(1e18 + 10) for _ in range(1001)] for _ in range(15)]
    n = int(input())
    
    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):
                    prime_power *= superprimes[i]
                    continue
                if i:
                    dp[i][j] = min([dp[i][j], dp[i - 1][j // (k + 1)] * prime_power])
                else:
                    dp[i][j] = prime_power
                prime_power *= superprimes[i]
    
    print(dp[9][n])

if __name__ == "__main__":
    find_smallest_superprime()

		 	  		 		 	 	   		    	 	 			