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