#include <bits/stdc++.h>
using namespace std;
const int mod = 1e+9 + 7;
int gcd(int a, int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long binomialCoeff(long long n, long long k) {
  long long res = 1;
  if (n < k) return 0;
  if (k > n - k) k = n - k;
  for (long long i = 0; i < k; ++i) {
    res *= (n - i);
    res /= (i + 1);
  }
  return res;
}
void solve() {
  long long q, index;
  cin >> q;
  for (int i = 7; i >= 2; i--) {
    if (q % i != 1) {
      index = i;
      break;
    }
  }
  cout << (q / index + 1) << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  cin >> t;
  while (t--) solve();
}
