#include <bits/stdc++.h>
using namespace std;
[[gnu::constructor]] void TIE() {
  cin.tie(nullptr)->sync_with_stdio(false);
  cout.tie(nullptr);
}
int main() {
  long long n, t = 1, a, b, ans = 0, k = 0;
  cin >> t;
  while (t--) {
    a = 0;
    cin >> n;
    for (int i = 9; i > 1; i--) {
      if (n % i == 0 && i != n && a < n / i) a = n / i;
    }
    n -= 1;
    for (int i = 9; i > 1; i--) {
      if (n % i == 0 && i != n && a < n / i) a = n / i;
    }
    cout << (a == 0 ? 1 : a) << "\n";
  }
  return 0;
}
