/******************************* In The Name Of God ********************************
Problem ID: 1086 - Cryptography (
http://acm.timus.ru/problem.aspx?space=1&num=1086)Time Limit: 2.0 sec
Memory Limit: 16 MB
Author: Hamidreza Hosseinkhani (hosseinkhani@live.com)
***********************************************************************************/
#include <iostream>
using namespace std;
#include <cmath>
bool prime( float num )
{
for ( int i = 2 ; i <= sqrt( num ) ; i++ )
if ( !( (int) num % i ) ) return false;
return true;
}
int main()
{
//ifstream cin( "in.txt" );
//ofstream cout( "out.txt" );
int k, n, *list, max = 0;
cin >> k;
list = new int [k];
for ( int i = 0 ; i < k ; i++ ) {
cin >> list[i];
if ( list[i] > max ) max = list[i];
}
int *primes = new int [max];
for ( int i = 2, c = 0 ; c < max ; i++ )
if ( prime( i ) ) {
primes[c] = i;
c++;
}
for ( int i = 0 ; i < k ; i++ )
cout << primes[list[i] - 1] << endl;
return EXIT_SUCCESS;
}