#include <bits/stdc++.h>
using namespace std;
vector<bool> sieve(int num){
const int N = num + 1;
vector<bool> isPrime(N, true);
isPrime[0] = isPrime[1] = false;
for (int i = 2; i * i < N; ++i){
if (isPrime[i]) {
for (int j = i * i; j < N; j += i){
isPrime[j] = false;
}
}
}
return isPrime;
}
int max_div(int num){
long long int highest = 1;
for (int i = num / 2; i >= 1; i--){
if (num % i == 0){
highest = i;
break;
}
}
return highest;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int t;
cin >> t;
while (t--) {
long long int n;
cin >> n;
if (n % 2 == 0){
cout << n / 2 << endl;;
}
else if (sieve(n)[n]){
cout << 1 << endl;
}
else {
long long int ans = max_div(n);
cout << ans << endl;
}
}
return 0;
}