#include<bits/stdc++.h>
using namespace std;
#define fastkor ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define endl '\n'
#define ll long long
#define dvect vector<int>vect
#define pb(x) push_back(x)
#define vectinL(n) for(ll i=0;i<n;i++){ ll x; cin >> x; vect.push_back(x);}
#define vectin(n) for(int i=0;i<n;i++){ int x; cin >> x; vect.push_back(x);}
#define vectout(v) for(auto p: v) cout<<p<<" "; cout<<endl;
#define sortkor(x) sort(x.begin(),x.end())
#define reversekor(x) reverse(x.begin(),x.end())
#define all(vect) vect.begin(),vect.end()
#define mini_pos(a) ( min_element((a).begin(), (a).end()) - (a).begin())
#define maxi_pos(a) ( max_element((a).begin(), (a).end()) - (a).begin())
#define F first
#define S second
#define gcd(a,b) __gcd(a,b)
#define YES1 cout<<"Case "<<case++<<": YES\n"
#define NO1 cout<<"Case "<<case++<<": NO\n"
#define precision(n) fixed<<setprecision(n)
#define testcase ll t; cin >>t; while(t--)
#define yes cout<<"yes\n";
#define Yes cout<<"Yes\n";
#define YES cout<<"YES\n"
#define no cout<<"no\n";
#define No cout<<"No\n";
#define NO cout<<"NO\n"
#define vectd vector<ll>vect(n)
const int N=2e5+10;
vector<pair<int,int>>moves=
{
{-1,0},{1,0},{0,-1},{0,1}
};
const int mod=1e9+7;
ll fact[N+10];
vector<bool>isprime;
vector<int>primegula;
map<int,int>mp;
template <typename T>
inline void operator>>(istream &istream, vector<T> &v)
{
for (T &i : v)
{
cin >> i;
}
}
int main()
{
fastkor;
testcase
{
ll n;
cin >> n;
ll ans=1;
for(ll i=2;i*i<=n;i++)
{
if(n%i==0)
{
ans=max(ans,i);
ans=max(ans,n/i);
break;
}
}
cout<<ans<<"\n";
}
}