#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<cstdlib>
using namespace std;
typedef long long ll;
struct node
{
char nam[100];
int c;
}cord[100];
int main()
{
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
int x=0,y=0;
if(n==0)
{
cout<<"0 0"<<endl;
}else
{
for(int i=0;i<n/3+10;i++)
{
for(int j=0;j<n/2+10;j++)
{
if(i*3+j*2==n)
{
x=i;
y=j;
}
}
}
if(x==0&&y==0)
{
cout<<"WA"<<endl;
}else
{
cout<<y<<" "<<x<<endl;
}
}
}
}