#include <cstdio>
using namespace std;
const int mod = 1e9 + 7;
int main()
{
    int T, n;
    scanf("%d", &T);
    while (T--)
    {
        long long ans = 1;
        int c2 = 0, c3 = 0;
        scanf("%d", &n);
        c3 = n / 3;
        int rst = n % 3;
		if (rst == 1) {
            if (c3) c3--, c2 += 2;
		}
		if (rst == 2) {
            c2++;
		}
		if (rst == 0) {

		}
        printf("%lld\n", ans);
    }
    return 0;
}
