#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include using namespace std; ll modpow(ll x,ll n){ ll ans=1; while(n){ if(n&1) ans=ans*x; x=x*x; n/=2; } return ans; } bool f(ll x,ll k){ ll cnt=0; ll i=2; while(pow(x,1/i)>=1){ cnt+=(ll)pow(x,1/i); i++; } if(cnt>=k) return true; else return false; } int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); int t; cin>>t; while(t--){ ll k; cin>>k; ll ng=0,ok=1e9+1; while(ok-ng>1){ ll mid=(ng+ok)/2; if(f(mid,k)) ok=mid; else ng=mid; } cout<