#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T &x) {
  x = 0;
  T f = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) x = (x << 3) + (x << 1) + (c ^ 48);
  x *= f;
}
int main() {
  int n;
  read(n);
  for (int i = 1; i <= n; i++) {
    int x;
    read(x);
    cout << x / 6 + (x % 6 == 0 ? 0 : 1) << endl;
  }
  return 0;
}
