// Author : Kamonasish Roy (Bullet)
// Time : 2025-03-02 14:02:10
#include<bits/stdc++.h>
using namespace std;
const long long M=1e6+10,MOD=1e9+7;
typedef long long ll;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int t=1;
cin>>t;
while(t--){
ll n;
cin>>n;
ll sum= n * (n+1LL)/2;
if(n==1){
cout<<n<<"\n";
continue;
}
ll answer=2;
ll two=0,three=0;
ll c=2,d=3;
while(c<=sum){
two++;
if(c * d<=sum){
three++;
d*=3LL;
answer=max(answer,(two+1)*(three+1));
}
c*=2LL;
answer=max(answer,two+1);
}
cout<<answer<<"\n";
}
return 0;
}