#include using namespace std; typedef long long LL; typedef pair pii; #ifdef DEBUG #define display(x) cerr << #x << " = " << x << endl; #define displaya(a, st, n)\ {cerr << #a << " = {";\ for(int qwq = (st); qwq <= (n); ++qwq) {\ if(qwq == (st)) cerr << a[qwq];\ else cerr << ", " << a[qwq];\ } cerr << "}" << endl;} #define displayv(v) displaya(v, 0, (int)(v).size() - 1) #define eprintf(...) fprintf(stderr, __VA_ARGS__) #else #define display(x) ; #define displaya(a, st, n) ; #define displayv(v) ; #define eprintf(...) if(0) fprintf(stderr, "...") #endif template bool chmin(T &a, const T &b) { return a > b ? a = b, true : false; } template bool chmax(T &a, const T &b) { return a < b ? a = b, true : false; } int a[1000]; LL solve(LL n) { if(n % 6 == 3 || n % 6 == 5) return n / 6; else if(n % 6 == 0) return n / 6 * 3; else if(n % 6 == 1) return n / 6 * 4 + 1; else if(n % 6 == 2) return n / 6 * 3 + 1; else if(n % 6 == 4) return n / 6 * 6 + 3; else assert(false); return -1; } int main() { ios::sync_with_stdio(false); int T; cin >> T; while(T--) { LL n; cin >> n; cout << solve(n) << '\n'; } // a[1] = 1; // for(int n = 2; n <= 100; ++n) { // int sum = 0; // for(int i = 1; i < n; ++i) // (sum += i * a[i]) %= n; // a[n] = sum; // printf("%d, ", a[n]); // if(n % 6 == 5) printf("\n"); // } return 0; }