#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int x, l;
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    cnt = 0;
    cin >> x;
    if (x % 7 != 0) {
      cnt++;
    }
    x /= 7;
    cout << x + cnt << endl;
  }
  return 0;
}
