
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <sstream>
#include <iomanip>
#include <queue>
#include <ctime>
using namespace std;
template <class T> void checkmin(T &t,T x){if (x < t) t = x;}
template <class T> void checkmax(T &t,T x){if (x > t) t = x;}
template <class T> void _checkmin(T &t, T x){if (t == -1) t = x; if (x < t) t = x;}
template <class T> void _checkmax(T &t, T x){if (t == -1) t = x; if (x > t) t = x;}
typedef pair <int,int> PII;
typedef pair <double,double> PDD;
typedef long long lld;
#define foreach(it,v) for (__typeof((v).begin()) it = (v).begin();it != (v).end();it++)
#define DEBUG(a) cout << #a" = " << (a) << endl;
#define DEBUGARR(a, n) for (int i = 0; i < (n); i++) { cout << #a"[" << i << "] = " << (a)[i] << endl; }


int w[1000001];
int ans[1000001];
void init(){
	w[1]=1;
	for(int i=2;i<=1000000;++i)
		if(!w[i])
		for(int j=i;j<=1000000;j+=i)
			w[j]=i;
	for(int i=2,k,t;i<=1000000;++i){
		for(t=i,k=1;t%w[i]==0;t/=w[i])++k;
		w[i]=w[t]*k;
	}
}

int main(){
	init();
	int i,a;
	memset(ans,-1,sizeof(ans));
	for (i=1;i<=1000000;i++)
		if (ans[(w[i]+1)/2]==-1) ans[(w[i]+1)/2] = i;
	int tt;
	scanf("%d",&tt);
	while(tt--){
		scanf("%d",&a);
		if (ans[a]!=-1) printf("%d\n",ans[a]);
		else printf("Too big\n");
	}


}
