#include<stdio.h>
int main()
{
int n,t;
scanf("%d",&t);
while(t--)
{
scanf("%d",&n);
if(n<2)
printf("WA\n");
else if(n%3==0)
printf("0 %d\n",n/3);
else if(n%3==1)
printf("2 %d\n",(n-4)/3);
else if(n%3==2)
printf("1 %d\n",(n-2)/3);
}
}