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