#include<stdio.h>
int main (void)
{
int T,N,x,y,m;
scanf("%d",&T);
while(T--){
scanf("%d",&N);
for(x = 0;x < N;++x){
m = N - 2*x;
y = m/3;
if(3*y + 2*x == N)
break;}
if(3*y + 2*x == N)
printf("%d %d\n",x,y);
else
printf("WA\n");}
return 0;
}