#include using namespace std; int a[1100]; int main(){ //freopen("a.in", "r", stdin); //freopen("b.out", "w", stdout); int i, j, k, T; long long n; scanf("%d", &T); while (T--){ scanf("%I64d", &n); if (n % 6 == 1){ printf("%I64d\n", n - n / 3ll); } else if ((n % 6 == 3) || (n % 6 == 5)){ printf("%I64d\n", n / 6ll); } else if (n % 6 == 4){ printf("%I64d\n", n - 1); } else{ printf("%I64d\n", n >> 1); } } return 0; }