#include<bits/stdc++.h>
using namespace std;

void s(){
	int k; cin >> k;
	int n = 1;
	while(n ++){
		int active = n;
		vector<int> a(n + 1, true);
		for(int i = 1; i <= n; i ++){
			for(int d = i; d <= n; d += i){
				if(a[d]) -- active;
				else ++ active;
				a[d] ^= true;
			}
		}
		if(active == k) break;
	}
	cout << n << endl;
}

int main(){
	int t; cin >> t; while(t --) s();
}
