#include <stdio.h>
int main ()
{
int t,n,x,y,i,j,flag,k,min,oy;
scanf("%d",&t);
while(t--)
{
scanf("%d",&n);
flag=0;
i=0;j=0;
min=n/2;
for(x=0;x<=n/2;++x)
{
for(y=0;y<=n/2;++y)
{
if(2*x+3*y==n)
{
flag=1;
if(x<min)
{
min=x;
oy=y;
}
else
continue;
}
}
}
if(flag==0)
printf("WA\n");
else
printf("%d %d\n",min,oy);
}
}