#include <bits/stdc++.h>
using namespace std;
#define int long long
const int N = 1e6 + 9;
bitset<N> f;
int spf[N], res[N];
vector<int> fact[N];
int32_t main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int n = N - 9;
vector<int> primes;
for (int i = 1; i < N; i++)
spf[i] = i;
for (int i = 2; i < N; i++)
{
for (int j = i; j < N; j += i)
{
spf[j] = min(spf[j], i);
}
}
f[1] = true;
for (int i = 2; i * i <= n; i++)
{
if (!f[i])
{
for (int j = i * i; j <= n; j += i)
{
f[j] = true;
}
}
}
for (int i = 2; i <= n; i++)
{
if (!f[i])
{
primes.push_back(i);
}
}
for (int i = 1; i < N - 1; i++)
{
int x = i;
while (x > 1)
{
int p = spf[x];
fact[i].push_back(p);
x /= p;
}
}
int mx = 0;
for (int i = 1; i < N - 1; i++)
{
map<int, int> cnt;
for (auto x : fact[i])
cnt[x]++;
for (auto x : fact[i + 1])
cnt[x]++;
cnt[2]--;
int ans = 1;
for (auto x : cnt)
ans *= (x.second + 1);
res[i] = max(res[i - 1], ans);
}
int t;
cin >> t;
while (t--)
{
int m;
cin >> m;
cout << res[m] << '\n';
}
return 0;
}