#include<cstdio>#include<cmath>#include<vector>#include<cstring>#include<map>#include<algorithm>using namespace std;typedef long long LL;const int maxn = 1000005;const LL limit = 1e18;LL f[maxn], n, T, x;int a[5] = { 2, 3, 5, 7 };void dfs(int x, int y, LL u){ if (x > 3 || u > limit) return; if (y) f[n++] = u; dfs(x + 1, 0, u); dfs(x, y + 1, u * a[x]);}int main(){ f[0] = n = 1; dfs(0, 0, 1); sort(f, f + n); scanf("%lld", &T); while (T--) { scanf("%lld", &x); printf("%lldn", f[x-1]); } return 0;}


