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