#SDNU1227. A great challenge.

A great challenge.

Description

In the legend, there lived the most intelligent person named Haroro in SDNU. Haroro likes to challenge other people on the prime problem. She is an unbeaten myth. Now, turn to you. If you can find out the most close to its prime number faster than Haroro, you will receive an unexpected gift. egeg: If the screen appears 2222, your answer should be 2323;If the screen appears 88, your answer should be 77; if the XX itself is prime, your answer should be XX;if the nearest XX prime number is two, then the answer is greater than its prime.

Format

Input

The first line of the input contains the single number T(1T100)T(1 \leq T \leq 100). Each of next T lines contains one number X(1X1000)X(1 \leq X \leq 1000).

Output

The output contains NN line, your answer should be the most close to its prime.

Samples

3
22
7
8
23
7
7