Problem hidden

IAPCR2D - Find The Number

Finding the number of all divisor of a number is too easy. But don’t worry, this problem is also quite easy.

You will be given the number of all divisor of the factorial of a number, you will have to find number. If there are multiple such number, you will have to find the smallest one. If there is no such numbers that meets the constraint print “nai”.

Input

The first line of the input will be T, denoting number of test cases. In the following T lines there will be only one integer N, denoting the number of all divisor of the factorial of a number X. It is guaranteed that X will be less than 102 + 10.

Constraints

1 ≤ t ≤ 105

0 ≤ n ≤ 1018

1 ≤ X < 102 + 10

Output

For each test case print the number X. If X does not exists or is greater than 104 then print "nai" (without the quotes) in a single line. Follow the sample input/output.

Example

Input:
5
1
2
3
4
5

Output:
1
2
nai
3
nai

Adicionado por:imranziad
Data:2016-06-03
Tempo limite:0.300s
Tamanho do fonte:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Linguagem permitida:Todas exceto: ASM64 CLOJURE ERL FSHARP GOSU JS-MONKEY PERL6 PY_NBC SCALA TCL
Origem:Intra AIUB Programming Contest (Jamil Siam)
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.