#include<stdio.h>
#include<math.h>
int main()
{
int T,x,y,i,j,k,n,h;
scanf("%d",&T);
while(T--)
{
scanf("%d",&n);
if(n==1||n==0)
{
printf("WA\n");
}
else
{
if(n%3==0)
{
x = 0;
y = n / 3;
}
if(n%3==2)
{
x = 1;
y = n/3;
}
if(n%3==1)
{
x = 2;
y = n/3-1;
}
printf("%d %d\n",x,y);
}
}
return 0;
}