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