description: Polycarp must pay exactly n burles at the checkout. He has coins of two nominal values: 1 burle and 2 burles. Polycarp likes both kinds of coins equally. So he doesn't want to pay with more coins of one type than with the other.
  
  Thus, Polycarp wants to minimize the difference between the count of coins of 1 burle and 2 burles being used. Help him by determining two non-negative integer values c_1 and c_2 which are the number of coins of 1 burle and 2 burles, respectively, so that the total value of that number of coins is exactly n (i. e. c_1 + 2 ⋅ c_2 = n), and the absolute value of the difference between c_1 and c_2 is as little as possible (i. e. you must minimize |c_1-c_2|).
  
  Input
  
  The first line contains one integer t (1 ≤ t ≤ 10^4) — the number of test cases. Then t test cases follow.
  
  Each test case consists of one line. This line contains one integer n (1 ≤ n ≤ 10^9) — the number of burles to be paid by Polycarp.
  
  Output
  
  For each test case, output a separate line containing two integers c_1 and c_2 (c_1, c_2 ≥ 0) separated by a space where c_1 is the number of coins of 1 burle and c_2 is the number of coins of 2 burles. If there are multiple optimal solutions, print any one.
  
  Example
  
  Input
  
  
  6
  1000
  30
  1
  32
  1000000000
  5
  
  
  Output
  
  
  334 333
  10 10
  1 0
  10 11
  333333334 333333333
  1 2
  
  Note
  
  The answer for the first test case is "334 333". The sum of the nominal values of all coins is 334 ⋅ 1 + 333 ⋅ 2 = 1000, whereas |334 - 333| = 1. One can't get the better value because if |c_1 - c_2| = 0, then c_1 = c_2 and c_1 ⋅ 1 + c_1 ⋅ 2 = 1000, but then the value of c_1 isn't an integer.
  
  The answer for the second test case is "10 10". The sum of the nominal values is 10 ⋅ 1 + 10 ⋅ 2 = 30 and |10 - 10| = 0, whereas there's no number having an absolute value less than 0.
solution: import java.util.*;
  import java.io.*;
  import java.util.Arrays;
  import java.util.Map.Entry;
   
  public class codeforces {
  	static String s;
  	static String t;
  	public static void main(String[] args) throws Exception {
  		int t=sc.nextInt();
  		while (t-->0) {
  			int n=sc.nextInt();
  			int c=n/3;
  			if(3*c==n-1) {
  				pw.println((c+1)+" "+(c));
  			}else if(3*c==n-2){
  				pw.println((c)+" "+(c+1));
  			}else {
  				pw.println(c+" "+c);
  			}
  		}
  		pw.close();
  	}
  	
  	public static boolean sol(int i,StringBuilder ss) {
  		if(i==s.length()) {
  			if(ss.length()==t.length()) {
  				for (int j = 0; j < t.length(); j++) {
  					if(ss.charAt(j)!=t.charAt(j))return false;
  				}
  				return true;
  			}else return false;
  		}
  		ss.append(s.charAt(i));
  		boolean take=sol(i+1,ss);
  		if(ss.length()>1) {
  			ss.delete(ss.length()-2, ss.length());
  		}else {
  			ss=new StringBuilder();
  		}
  		boolean leave=sol(i+1,ss);
  		return leave||take;
  	}
  	public static long eval(String s) {
  		long p=1;
  		long res=0;
  		for (int i = 0; i < s.length(); i++) {
  			res+=p*(s.charAt(s.length()-1-i)=='1'?1:0);
  			p*=2;
  		}
  		return res;
  	}
  	
  	public static String binary(long x) {
  		String s="";
  		while(x!=0) {
  			s=(x%2)+s;
  			x/=2;
  		}
  		return s;
  	}
  	
  	public static boolean allSame(String s) {
  		char x=s.charAt(0);
  		for (int i = 0; i < s.length(); i++) {
  			if(s.charAt(i)!=x)return false;
  		}
  		return true;
  	}
  	
  	public static boolean isPalindrom(String s) {
  		int l=0;
  		int r=s.length()-1;
  		while(l<r) {
  			if(s.charAt(r--)!=s.charAt(l++))return false;
  			
  		}
  		return true;
  	}
  	 
  	public static String putAtFront(String s,char c) {
  		if(s.length()==0)return s;
  		if(s.charAt(s.length()-1)==c) {
  			return s.charAt(s.length()-1)+putAtFront(s.substring(0,s.length()-1), c);
  		}else {
  			return putAtFront(s.substring(0,s.length()-1), c)+s.charAt(s.length()-1);
  		}
  	}
  	
  	public static boolean isSubString(String s,String t) {
  		int ls=s.length();
  		int lt=t.length();
  		boolean res=false;
  		for (int i = 0; i <=lt-ls; i++) {
  			if(t.substring(i, i+ls).equals(s)) {
  				res=true;
  				break;
  			}
  		}
  		return res;
  	}
  	
  	public static boolean isSorted(int[]a) {
  		for (int i = 0; i < a.length-1; i++) {
  			if(a[i]>a[i+1])return false;
  		}
  		return true;
  	}
  	
  	public static boolean isPrime(int n)
      {
   
          // Check if number is less than
          // equal to 1
          if (n <= 1)
              return false;
   
          // Check if number is 2
          else if (n == 2)
              return true;
   
          // Check if n is a multiple of 2
          else if (n % 2 == 0)
              return false;
   
          // If not, then just check the odds
          for (int i = 3; i <= Math.sqrt(n); i += 2)
          {
              if (n % i == 0)
                  return false;
          }
          return true;
      }
  	public static long power(long x,long k) {
  		long res=1;
  		long mod=((int)1e9)+7;
  		for (int i = 0; i < k; i++) {
  			res*=x;
  			res=res%mod;
  		}
  		return res;
  	}
  	public static int whichPower(int x) {
  		int res=0;
  		for (int j = 0; j < 31; j++) {
  			if((1<<j&x)!=0) {
  				res=j;
  				break;
  			}
  		}
  		return res;
  	}
   
  	public static long evaln(String x,int n) {
  		long res=0;
  		for (int i = 0; i < x.length(); i++) {
  			res+=Long.parseLong(x.charAt(x.length()-1-i)+"")*Math.pow(n, i);
  		}
  		return res;
  	}
  	static void merge(int[] arr,int b,int m,int e) {
  		int len1=m-b+1,len2=e-m;
  		int[] l=new int[len1];
  		int[] r=new int[len2];
  		for(int i=0;i<len1;i++)l[i]=arr[b+i];
  		for(int i=0;i<len2;i++)r[i]=arr[m+1+i];
  		int i=0,j=0,k=b;
  		while(i<len1 && j<len2) {
  			if(l[i]<r[j])arr[k++]=l[i++];
  			else arr[k++]=r[j++];
  		}
  		while(i<len1)arr[k++]=l[i++];
  		while(j<len2)arr[k++]=r[j++];
  		return;
  	}
  	static void mergesortidx(int[] arr,int[]idx,int b,int e) {
  		if(b<e) {
  			int m=b+(e-b)/2;
  			mergesortidx(arr,idx,b,m);
  			mergesortidx(arr,idx,m+1,e);
  			mergeidx(arr,idx,b,m,e);
  		}
  		return;
  		
  	}
  	
  	static void mergeidx(int[] arr,int[]idx,int b,int m,int e) {
  		int len1=m-b+1,len2=e-m;
  		int[] l=new int[len1];
  		int[] lidx=new int[len1];
  		int[] r=new int[len2];
  		int[] ridx=new int[len2];
  		for(int i=0;i<len1;i++) {
  			l[i]=arr[b+i];
  			lidx[i]=idx[b+i];
  		}
  		for(int i=0;i<len2;i++) {
  			r[i]=arr[m+1+i];
  			ridx[i]=idx[m+1+i];
  		}
  		int i=0,j=0,k=b;
  		while(i<len1 && j<len2) {
  			if(l[i]<r[j]) {
  				arr[k++]=l[i++];
  				idx[k-1]=lidx[i-1];
  			}
  			else {
  				arr[k++]=r[j++];
  				idx[k-1]=ridx[j-1];
  			}
  		}
  		while(i<len1) {
  			idx[k]=lidx[i];
  			arr[k++]=l[i++];
  		}
  		while(j<len2) {
  			idx[k]=ridx[j];
  			arr[k++]=r[j++];
  		}
  		return;
  	}
  	static void mergesort(int[] arr,int b,int e) {
  		if(b<e) {
  			int m=b+(e-b)/2;
  			mergesort(arr,b,m);
  			mergesort(arr,m+1,e);
  			merge(arr,b,m,e);
  		}
  		return;
  		
  	}
  	
  	static long mergen(int[] arr,int b,int m,int e) {
  		int len1=m-b+1,len2=e-m;
  		int[] l=new int[len1];
  		int[] r=new int[len2];
  		for(int i=0;i<len1;i++)l[i]=arr[b+i];
  		for(int i=0;i<len2;i++)r[i]=arr[m+1+i];
  		int i=0,j=0,k=b;
  		long c=0;
  		while(i<len1 && j<len2) {
  			if(l[i]<r[j])arr[k++]=l[i++];
  			else {
  				arr[k++]=r[j++];
  				c=c+(long)(len1-i);
  			}
  		}
  		while(i<len1)arr[k++]=l[i++];
  		while(j<len2)arr[k++]=r[j++];
  		return c;
  	}
  	static long mergesortn(int[] arr,int b,int e) {
  		long c=0;
  		if(b<e) {
  			int m=b+(e-b)/2;
  			c=c+(long)mergesortn(arr,b,m);
  			c=c+(long)mergesortn(arr,m+1,e);
  			c=c+(long)mergen(arr,b,m,e);
  		}
  		return c;
  		
  	}
  	public static long fac(int n) {
  		if(n==0)return 1;
  		return n*fac(n-1);
  	}
  	public static long gcd(long a, long b)
      {
        if (b == 0)
          return a;
        return gcd(b, a % b);
      }
       
  	public static long summ(long x) {
  		long sum=0;
  		while(x!=0) {
  			sum+=x%10;
  			x=x/10;
  		}
  		return sum;
  				
  	}
  	
  	public static void sort2darray(Integer[][]a){
  		Arrays.sort(a,Comparator.<Integer[]>comparingInt(x -> x[0]).thenComparingInt(x -> x[1]));
   
  	}
  	static class Scanner {
  		StringTokenizer st;
  		BufferedReader br;
  		public Scanner(InputStream s) {
  			br = new BufferedReader(new InputStreamReader(s));
  		}
  		public Scanner(String file) throws FileNotFoundException {
  			br = new BufferedReader(new FileReader(file));
  		}
   
  		public String next() throws IOException {
  			while (st == null || !st.hasMoreTokens())
  				st = new StringTokenizer(br.readLine());
  			return st.nextToken();
  		}
  		
  		public int nextInt() throws IOException {
  			return Integer.parseInt(next());
  		}
  		public long nextLong() throws IOException {
  			return Long.parseLong(next());
  		}
  		public String nextLine() throws IOException {
  			return br.readLine();
  		}
  		public double nextDouble() throws IOException {
  			return Double.parseDouble(next());
  		}
  		public boolean ready() throws IOException {
  			return br.ready();
  		}
  		public int[] nextArrint(int size) throws IOException {
  			int[] a=new int[size];
  			for (int i = 0; i < a.length; i++) {
  				a[i]=sc.nextInt();
  			}
  			return a;
  		}
  		public long[] nextArrlong(int size) throws IOException {
  			long[] a=new long[size];
  			for (int i = 0; i < a.length; i++) {
  				a[i]=sc.nextLong();
  			}
  			return a;
  		}
  		public int[][] next2dArrint(int rows,int columns) throws IOException{
  			int[][]a=new int[rows][columns];
  			for (int i = 0; i < rows; i++) {
  				for (int j = 0; j < columns; j++) {
  					a[i][j]=sc.nextInt();
  				}
  			}
  			return a;
  		}
  		public long[][] next2dArrlong(int rows,int columns) throws IOException{
  			long[][]a=new long[rows][columns];
  			for (int i = 0; i < rows; i++) {
  				for (int j = 0; j < columns; j++) {
  					a[i][j]=sc.nextLong();
  				}
  			}
  			return a;
  		}
  	}
  	static Scanner sc=new Scanner(System.in);
  	static PrintWriter pw=new PrintWriter(System.out);
  }
  
  