using namespace std;


int main(){
    vector<int> pn{1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199};
    vector<int> pn2{pn};
    int t;
    cin >> t;
    for(int a0 = 0; a0 < t; a0++){
        int n;
        cin >> n;
        if (n < pn2.size())
            cout << pn2[n] << endl;
        else {
            for (int i = pn2.size(); i <= n; i++){
                int x = pn2[pn2.size() -1] + 2; // next odd number
                for (int y = 2; y < pn2.size(); ++y)
                    while ((x % pn2[y])==0) {
                        x += 2; // next odd number
                        y = 2; // start looking again
                    }
                pn2.push_back(x); 
//                cout << pn2[pn2.size()-1] << endl;
            }
            cout << pn2[n] << endl;
        }
    }
    return 0;
}