Chocolate Day

0

0 votes
Problem

Mr. APPLEPIC is a good Coder and is also very fond of prime numbers.Today while playing with prime numbers he realizes that today is Chocolate Day and so he goes to market to buy some for his very special friend.

Meanwhile his Little brother Mr. Tafy who is in standard 1 visits his room and makes some changes to the prime sequence Mr. APPLEPIC was playing with.

When he returns Tafy demands for the next terms of sequence or he has to loose the Chocolate.

The first few sequence terms after modification are given as follows 3, 5, 10, 47, 1812.

Mr. APPLEPIC wants your help in not loosing his Chocolate,or he will remain Forever Alone.

So you have to find the Nth term of given sequence.

Input

first line contain t test cases, each next t lines contain N

Output

The Nth term of sequence

Constraints

1<=N<=10

1<=t<=10

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?