#include using namespace std; typedef long long LL; int main() { int T; const int steps[10] = {3, 4, 3, 1, 6, 1}; const int init[10] = {0, 1, 1, 0, 3, 0}; scanf("%d", &T); while (T--) { LL n; cin >> n; int finger = n % 6; cout << n / 6 * steps[finger] + init[finger] << endl; } return 0; }