#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, t = 0, i, j;
  cin >> i;
  for (j = 0; j < i; j++) {
    cin >> x;
    if (x % 6 == 0)
      x = x / 6;
    else if (x / 6 < 1)
      x = 1;
    else if (x % 6 >= 1 && x / 6 >= 1) {
      x = x / 6;
      x++;
    }
    cout << x << "\n";
  }
  return 0;
}
