#include using namespace std; #define ll long long int a[6]={0,1,1,0,3,0},d[6]={3,4,3,1,6,1}; int main(void) { // freopen("e.in","r",stdin); int T; scanf("%d",&T); while (T--) { ll n; scanf("%I64d",&n); ll ans = a[n%6] + n/6*d[n%6]; printf("%I64d\n",ans); } return 0; }