P16077 [ICPC 2023 NAC] Power of Divisors

Description

Consider a positive integer $ n $. Let $ f(n) $ be the number of positive integer divisors of $ n $. For example, if $ n = 8 $ then $ f(n) = 4 $, since the divisors of $ 8 $ are $ 1, 2, 4 $ and $ 8 $. Now, consider a positive integer $ x $. What is the smallest value of $ n $ such that $ n^{f(n)} = x $?

Input Format

The single line of input contains a single integer $ x $ ($ 1 \le x \le 10^{18} $). This is the $ x $ of the statement above.

Output Format

Output a single integer, which is the smallest value of $ n $ such that $ n^{f(n)} = x $, or $ -1 $ if no such value of $ n $ exists.