#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int n;int sum=0;
cin>>n;
for(int i=1;i<=n;i++)
{
if(i%3)
sum++;
if(sum==3)
sum=0;
}
cout<<sum<<endl;
}
return 0;
}