#include using namespace std; typedef long long LL; int main() { int T; scanf("%d", &T); while (T--) { LL n; scanf("%I64d", &n); if (n == 1) puts("1"); else { LL x = (n - 2) / 6, y = (n - 2) % 6; if (y == 0 || y == 4) printf("%I64d\n", n / 2); else if (y == 1 || y == 3) printf("%I64d\n", x); else if (y == 2) printf("%I64d\n", n - 1); else printf("%I64d\n", n - (2 * x + 2)); } } }