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 \cdot 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 \le t \le 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 \le n \le 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 \ge 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.


-----Examples-----

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 \cdot 1 + 333 \cdot 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 \cdot 1 + c_1 \cdot 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 \cdot 1 + 10 \cdot 2 = 30$ and $|10 - 10| = 0$, whereas there's no number having an absolute value less than $0$.

Source: codeforces | Difficulty: EASY
Tags: Mathematics

Greedy algorithms


Solutions:
import math
t = int(input())
for _ in range(t):
	a = int(input())
	if a % 3 == 1:
		c2 = (a - 1) // 3
		c1 = a - c2 * 2
	if a % 3 == 2:
		c1 = (a - 2) // 3
		c2 = (a - c1) // 2
	if a % 3 == 0:
		c1 = a // 3
		c2 = a // 3
	print(f'{c1} {c2}')


t = int(input())
while t != 0:
	n = int(input())
	c2 = int(n / 3)
	c1 = n - c2 * 2
	s = abs(c1 - c2)
	if s <= 1:
		print(c1, c2)
	else:
		d = c1 - s
		f = c2 + 1
		print(d, f)
	t = t - 1


import math
test = int(input())
for i in range(test):
	num = int(input())
	div = float(num / 3)
	a = math.ceil(div)
	b = math.floor(div)
	if a + 2 * b != num:
		a = math.floor(div)
		b = math.ceil(div)
	print(a, b)


import collections as cc
import bisect as bi
import heapq as hp
import math as mt
import itertools as it
import sys
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
for tc in range(int(input())):
	(n,) = I()
	a = n // 3
	b = n // 3
	if n % 3 == 1:
		a += 1
	if n % 3 == 2:
		b += 1
	print(a, b)


import math, sys

def solve():
	n = int(input())
	if n % 3 == 0:
		print(n // 3, n // 3)
		return
	c2 = (n - 1) // 3
	c1 = 1 + c2
	if c1 + 2 * c2 == n:
		print(c1, c2)
	else:
		print(c2, c1)
t = int(input())
while t != 0:
	solve()
	t -= 1


t = int(input())
for i in range(t):
	n = int(input())
	c1 = n // 3
	c2 = n - c1
	if c2 % 2 != 0:
		c1 += 1
		c2 -= 1
	print(c1, c2 // 2)


import math
n = int(input())
for i in range(0, n):
	t = int(input())
	ans = t / 3
	if math.floor(ans) + math.ceil(ans) * 2 == t:
		print(str(math.floor(ans)) + ' ' + str(math.ceil(ans)))
	else:
		print(str(math.ceil(ans)) + ' ' + str(math.floor(ans)))


import math
t = int(input())
for case in range(t):
	n = int(input())
	possibilities = [(math.floor(n / 3), math.ceil(n / 3)), (math.ceil(n / 3), math.floor(n / 3))]
	if possibilities[0][0] + 2 * possibilities[0][1] == n:
		print(possibilities[0][0], ' ', possibilities[0][1])
	elif possibilities[1][0] + 2 * possibilities[1][1] == n:
		print(possibilities[1][0], ' ', possibilities[1][1])


class Pay:

	def __init__(self, amt):
		self.v = amt

	def find_c1c2(self):
		c1 = self.v // 3
		c2 = self.v // 3
		if self.v % 3 == 0:
			return (c1, c2)
		elif self.v % 3 == 1:
			return (c1 + 1, c2)
		else:
			return (c1, c2 + 1)
t = int(input())
for _ in range(t):
	P = Pay(int(input()))
	(c1, c2) = P.find_c1c2()
	print(c1, c2)


n = int(input())
for i in range(n):
	x = int(input())
	a = round(x / 3)
	b = x - 2 * a
	print(b, a)


for t in range(int(input())):
	n = int(input())
	a = n // 3
	b = n // 3
	co = n % 3
	if co == 1:
		print(a + 1, b)
	elif co == 2:
		print(a, b + 1)
	else:
		print(a, b)


t = int(input())
for _ in range(t):
	n = int(input())
	if n % 3 == 0:
		print(n // 3, n // 3)
	elif n % 3 == 2:
		print(n // 3, n // 3 + 1)
	else:
		print(n // 3 + 1, n // 3)


import sys
t = int(sys.stdin.readline())
for _ in range(t):
	n = int(sys.stdin.readline())
	c1 = n // 3
	if (n - c1) % 2 == 0:
		c2 = int((n - c1) / 2)
	else:
		c2 = c1
		c1 = c1 + 1
	sys.stdout.write(str(c1) + ' ' + str(c2) + '\n')


t = int(input())
while t != 0:
	n = int(input())
	a = n / 3
	b = int(a)
	c1 = abs(b + 1)
	c2 = abs(b - 1)
	l = [c1, b]
	l.sort()
	l = l[::-1]
	l1 = [c2, b]
	l1.sort()
	l1 = l[::-1]
	l2 = [b, b]
	if l[0] + 2 * l[1] == n:
		print(*l)
	if l1[0] + 2 * l1[1] == n:
		print(*l1)
	if l2[0] + 2 * l2[1] == n:
		print(*l2)
	t = t - 1


for q in range(int(input())):
	n = int(input())
	k = n // 3
	ed = k
	dv = k
	if n - k * 3 == 0:
		print(ed, dv)
	elif n - k * 3 == 1:
		print(ed + 1, dv)
	else:
		print(ed, dv + 1)


x = int(input())
c1 = 0
c2 = 0
for i in range(x):
	n = int(input())
	if n % 3 == 0:
		c1 = n // 3
		c2 = c1
	elif n % 3 == 1:
		c2 = n // 3
		c1 = c2 + 1
	else:
		c1 = n // 3
		c2 = c1 + 1
	print(c1, c2)


t = int(input())
for i in range(t):
	n = int(input())
	c11 = 0
	c12 = 0
	for c in range(1000):
		if (n - c) % 3 == 0:
			c11 = (n - c) // 3 + c
			c12 = (n - c11) // 2
			break
		elif (n - 2 * c) % 3 == 0:
			c11 = (n - 2 * c) // 3
			c12 = (n - c11) // 2
			break
	print(c11, c12)


t = int(input())
for i in range(t):
	x = int(input())
	if x % 3 == 0:
		print(int(x / 3), int(x / 3))
	elif x % 3 == 1:
		print(int(x / 3) + 1, int(x / 3))
	else:
		print(int(x / 3), int(x / 3) + 1)


cases = int(input())
for case in range(cases):
	n = int(input())
	c1 = n // 3
	if n % 3 == 0:
		print(c1, c1)
	elif n % 3 == 1:
		print(c1 + 1, c1)
	else:
		print(c1, c1 + 1)


T = int(input())
for i in range(T):
	n = int(input())
	t = int(n / 3)
	r = n % 3
	if r == 0:
		print(t, t)
	elif r == 1:
		print(t + 1, t)
	else:
		print(t, t + 1)


n = int(input())
for i in range(n):
	s = int(input())
	if s % 3 == 0:
		print(s // 3, s // 3)
	elif s % 3 == 2:
		print(s // 3, s // 3 + 1)
	else:
		print(s // 3 + 1, s // 3)


for _ in range(int(input())):
	n = int(input())
	c2 = n // 3
	c1 = c2
	if n % 3 == 1:
		c1 += 1
	elif n % 3 == 2:
		c2 += 1
	print(c1, c2)


cases = int(input())
all_cases = [int(input()) for i in range(cases)]

def minimiser(all_cases):
	for i in all_cases:
		amount = i // 3
		if i % 3 == 0:
			print(str(amount) + ' ' + str(amount))
		elif i % 3 == 1:
			print(str(amount + 1) + ' ' + str(amount))
		elif i % 3 == 2:
			print(str(amount) + ' ' + str(amount + 1))
minimiser(all_cases)


n = int(input())
ans1 = []
ans2 = []
for i in range(n):
	k = int(input())
	a1 = k // 3
	a2 = k // 3
	k %= 3
	if k == 1:
		a1 += 1
	elif k == 2:
		a2 += 1
	ans1.append(a1)
	ans2.append(a2)
i = 0
while i < n:
	print(ans1[i], ans2[i])
	i += 1


t = int(input())
while t:
	n = int(input())
	if n % 3 == 0:
		c1 = n // 3
		c2 = n // 3
	elif n % 3 == 1:
		c1 = n // 3 + 1
		c2 = n // 3
	else:
		c1 = n // 3
		c2 = c1 + 1
	print(c1, end=' ')
	print(c2)
	t -= 1


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	a = 0
	b = 0
	if n % 3 == 1:
		a += 1
	elif n % 3 == 2:
		b += 1
	a += n // 3
	b += n // 3
	print(a, b)


from math import ceil
t = int(input())
for i in range(t):
	n = int(input())
	a1 = abs(n - n // 3 * 2 - n // 3)
	a2 = abs(n - ceil(n / 3) * 2 - ceil(n / 3))
	if a1 > a2:
		print(n - ceil(n / 3) * 2, ceil(n / 3))
	else:
		print(n - n // 3 * 2, n // 3)


def f(n):
	ed = n // 3
	dv = n // 3
	if n % 3 != 0:
		if n % 3 == 1:
			ed += 1
		else:
			dv += 1
	return (ed, dv)
t = int(input())
a = []
for i in range(t):
	n = int(input())
	a.append(f(n))
for x in a:
	print(*x)


import math
for _ in range(int(input())):
	n = int(input())
	(c1, c2) = (0, 0)
	c2 = math.ceil(n / 3.0)
	c3 = math.floor(n / 3.0)
	c1 += n - 2 * c2
	c4 = n - 2 * c3
	(a, b) = (c1, c2) if abs(c1 - c2) < abs(c4 - c3) else (c4, c3)
	print(a, b)


for s in [*open(0)][1:]:
	s = int(s)
	print('%s %s' % (s // 3 + (s % 3 == 1), s // 3 + (s % 3 == 2)))


for _ in range(int(input())):
	n = int(input())
	r = n % 3
	q = n // 3
	(a, b) = (0, 0)
	a = b = q
	if r == 1:
		a += 1
	elif r == 2:
		b += 1
	print(a, b)


T = int(input())
for t in range(T):
	n = int(input())
	x = n // 3
	c1 = x
	c2 = x
	if n % 3 == 1:
		c1 += 1
	elif n % 3 == 2:
		c2 += 1
	print(c1, c2)


for _ in range(int(input())):
	n = int(input())
	c2 = n // 3
	c1 = n - 2 * c2
	mini = abs(c2 - c1)
	c2_t = n // 3 + 1
	c1_t = n - 2 * c2_t
	mini_t = abs(c2_t - c1_t)
	if mini < mini_t:
		print(c1, c2)
	else:
		print(c1_t, c2_t)


for i in range(int(input())):
	n = int(input())
	print(n // 3 + int(n % 3 == 1), n // 3 + int(n % 3 == 2))


import math

def find(n):
	a = math.ceil(n / 3)
	b = math.floor((n - a) / 2)
	if a + 2 * b == n:
		print(a, b)
	else:
		print(b, a)
t = int(input())
l = []
for i in range(t):
	a = int(input())
	l.append(a)
for i in range(t):
	find(l[i])


import math
n = int(input())
for i in range(n):
	a = int(input())
	b = a / 3
	if math.ceil(b) * 2 + int(b) == a:
		print(int(b), math.ceil(b))
	else:
		print(math.ceil(b), int(b))


for _ in range(int(input())):
	n = int(input())
	two = n // 3
	if n % 3 == 2:
		two += 1
	one = n - two * 2
	print(one, two)


t = int(input())
for _ in range(t):
	n = int(input())
	c1 = n // 3
	c2 = n // 3
	rem = n % 3
	if rem != 0:
		if rem & 1:
			c1 += 1
		else:
			c2 += 1
	print(c1, c2)


t = int(input())
while t > 0:
	t = t - 1
	n = int(input())
	if n % 3 == 1:
		c1 = n // 3 + 1
		c2 = n // 3
	elif n % 3 == 2:
		c1 = n // 3
		c2 = n // 3 + 1
	else:
		c1 = c2 = n // 3
	print(c1, c2, sep=' ')


for i in range(int(input())):
	x = int(input())
	print(x // 3 + int(x % 3 == 1), x // 3 + int(x % 3 == 2))


from sys import stdin, stdout

def main():
	for _ in range(int(input())):
		n = int(input())
		r = 0
		r1 = 0
		if n % 3 == 1:
			r = 1
		elif n % 3 == 2:
			r1 = 1
		print(n // 3 + r, n // 3 + r1)
main()


def solve():
	n = int(input())
	(c1, c2) = (int(n / 3), int(n / 3))
	if n % 3 == 2:
		c2 += 1
	elif n % 3 == 1:
		c1 += 1
	print(f'{c1} {c2}')
T = int(input())
for t in range(T):
	solve()


for _ in range(int(input())):
	n = int(input())
	m = n // 3
	if 2 * m == n - m:
		print(m, m)
	elif 2 * m == n - m - 1:
		print(m + 1, m)
	elif 2 * (m + 1) == n - m:
		print(m, m + 1)


t = int(input())
for k in range(t):
	n = int(input())
	x = n // 3
	y = n % 3
	if y == 1:
		print(x + y, x)
	elif y == 2:
		print(x, x + 1)
	else:
		print(x, x)


t = int(input())
for i in range(t):
	n = int(input())
	sm = n // 3
	bg = sm + 1
	if n % 3 == 0:
		print(sm, sm)
	elif n % 3 != 0 and 2 * bg + sm == n:
		print(sm, bg)
	elif n % 3 != 0 and 2 * sm + bg == n:
		print(bg, sm)


import os
import sys
from io import BytesIO, IOBase
_print = print
BUFSIZE = 8192

def dbg(*args, **kwargs):
	_print('\x1b[95m', end='')
	_print(*args, **kwargs)
	_print('\x1b[0m', end='')

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def inp():
	return sys.stdin.readline().rstrip()

def mpint():
	return map(int, inp().split(' '))

def itg():
	return int(inp())

def solve():
	n = itg()
	k = n // 3
	if n % 3 == 0:
		return (k, k)
	elif n % 3 == 1:
		return (k + 1, k)
	else:
		return (k, k + 1)

def main():
	for _ in range(itg()):
		print(*solve())
DEBUG = 0
URL = 'https://codeforces.com/contest/1551/problem/A'
if DEBUG == 1:
	import requests
	from ACgenerator.Y_Test_Case_Runner import TestCaseRunner
	runner = TestCaseRunner(main, URL)
	inp = runner.input_stream
	print = runner.output_stream
	runner.checking()
else:
	if DEBUG != 2:
		dbg = lambda *args, **kwargs: ...
		(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
	if DEBUG == 3:

		def print(*args, **kwargs):
			_print(*args, **kwargs)
			sys.stdout.flush()
	main()


import math
t = int(input())
val = []
for _ in range(t):
	val.append(int(input()))
c1 = 0
c2 = 0
for n in val:
	if n == 1:
		print('1 0')
	elif n == 2:
		print('0 1')
	else:
		c1 = n // 3
		while True:
			if (n - c1) % 2 == 0:
				c2 = (n - c1) // 2
				break
			else:
				c1 += 1
		print('{} {}'.format(c1, c2))


testcases = int(input())
for i in range(testcases):
	x = int(input())
	if x % 3 == 0:
		print(str(x // 3) + ' ' + str(x // 3))
	elif x % 3 == 1:
		print(str(x // 3 + 1) + ' ' + str(x // 3))
	else:
		print(str(x // 3) + ' ' + str(x // 3 + 1))


c1 = 0
c2 = 0
for i in range(int(input())):
	n = int(input())
	y = n / 3
	c1 = y
	c2 = y
	if n % 3 == 1:
		c1 += 1
	elif n % 3 == 2:
		c2 += 1
	print(int(c1), int(c2))


t = int(input())
results = []
for _ in range(t):
	n = int(input())
	x1 = 0
	x2 = 0
	nguyen = int(n / 3)
	x1 = nguyen
	x2 = nguyen
	if n % 3 == 1:
		x1 += 1
	elif n % 3 == 2:
		x2 += 1
	result = []
	result.append(x1)
	result.append(x2)
	results.append(result)
for i in results:
	print(str(i[0]) + ' ' + str(i[1]))


from itertools import product
from math import ceil, gcd, sqrt
import string
from decimal import Decimal

def binary_table(string_with_all_characters, length_to_make):
	return [''.join(x) for x in product(string_with_all_characters, repeat=length_to_make)]

def all_possible_substrings(string):
	return [int(string[i:j]) for i in range(len(string)) for j in range(i + 1, len(string) + 1)]

def number_of_substrings(length):
	return int(length * (length + 1) / 2)
for enumeration in range(int(input())):
	num = int(input())
	num_of_2 = num / 3
	if num_of_2 == int(num_of_2):
		print(int(num_of_2), int(num_of_2))
	else:
		val = int(num_of_2)
		val_2 = ceil(num_of_2)
		if val * 2 + (val - 1) * 1 == num:
			print(val - 1, val)
		elif val_2 * 2 + (val_2 - 1) * 1 == num:
			print(val_2 - 1, val_2)
		elif (val - 1) * 2 + val == num:
			print(val, val - 1)
		elif (val_2 - 1) * 2 + val_2 == num:
			print(val_2, val_2 - 1)
		else:
			print('X', val, val_2, num_of_2)


for _ in range(int(input())):
	temp = int(input())
	x = temp // 3
	if temp % 3 == 0:
		print(str(x), str(x))
	elif temp % 3 == 1:
		print(str(x + 1), str(x))
	else:
		print(str(x), str(x + 1))


n = int(input())
while n:
	n -= 1
	p = int(input())
	p1 = 1 if p % 3 == 1 else 0
	p2 = 1 if p % 3 == 2 else 0
	print(p // 3 + p1, p // 3 + p2)


q = int(input())
for _ in range(q):
	s = int(input())
	if s % 3 == 0:
		x = s // 3
		y = (s - x) // 2
		print(x, y)
	else:
		x = s // 3
		y = (s - x) // 2
		z = s - x - y
		if x + 2 * y == s:
			print(x, y)
		elif y + 2 * x == s:
			print(y, x)
		elif x + 2 * z == s:
			print(x, z)
		elif z + 2 * x == s:
			print(z, x)


tc = int(input())
for i in range(tc):
	n = int(input())
	c = n // 3
	if c + 2 * c == n:
		print(str(c) + ' ' + str(c))
	elif n % 3 == 1:
		print(str(c + 1) + ' ' + str(c))
	else:
		print(str(c) + ' ' + str(c + 1))


for s in [*open(0)][1:]:
	n = int(s)
	print((c := (n // 3 + n % 3 % 2)), (n - c) // 2)


t = int(input())
for i in range(0, t):
	n = int(input())
	temp1 = n
	a = 0
	b = 0
	if n % 3 == 0:
		print(n // 3, n // 3)
	elif (n - 1) % 3 == 0:
		print((n - 1) // 3 + 1, (n - 1) // 3)
	else:
		print((n - 2) // 3, (n - 2) // 3 + 1)


def main():
	from sys import stdin, stdout
	t = int(input())
	for _ in range(t):
		n = int(input())
		if n % 3 == 0:
			print(n // 3, n // 3)
		elif n % 3 == 1:
			print(n // 3 + 1, n // 3)
		else:
			print(n // 3, n // 3 + 1)
main()


l = []
for i in range(int(input())):
	l.append(int(input()))
for n in l:
	if n == 1:
		print(1, 0)
		continue
	elif n % 3 == 0:
		print(int(n / 3), int(n / 3))
	else:
		c1 = round(n / 3)
		c2 = c1 - 1
		if c2 + 2 * c1 != n:
			c2 = c1 + 1
		print(c2, c1)


t = int(input())
l = [int(input()) for i in range(t)]
for n in l:
	c = n // 3
	if n % 3 == 0:
		print('%d %d' % (c, c))
	elif n % 3 == 1:
		print('%d %d' % (c + 1, c))
	elif n % 3 == 2:
		print('%d %d' % (c, c + 1))


import math
from array import *
c = array('i')
t = int(input())
for z in range(0, t):
	n = int(input())
	a = b = math.floor(n / 3)
	if n - 3 * a == 1:
		a = a + 1
	elif n - 3 * a == 0:
		a = a
		b = b
	else:
		b = b + 1
	c.extend([a, b])
for i in range(0, t):
	print(c[2 * i], c[1 + 2 * i])


import collections
import math
import sys
t = int(input())
for x in range(t):
	n = int(input())
	if n % 3 == 0 or n % 3 == 1:
		print(n // 3 + n % 3, n // 3)
	else:
		print(n // 3, n // 3 + 1)


t = int(input())
if t >= 1 and t <= 10000:
	lan = []
	for i in range(t):
		n = int(input())
		if n >= 1 and n <= 10 ** 9:
			c = n // 3
			if n % 3 == 0:
				c1 = c
				c2 = c
				lan.append(f'{c1} {c2}')
			elif n % 3 == 1:
				c1 = c + 1
				c2 = c
				lan.append(f'{c1} {c2}')
			elif n % 3 == 2:
				c1 = c
				c2 = c + 1
				lan.append(f'{c1} {c2}')
	print(*lan, sep='\n')


t = int(input())
while t:
	num = int(input())
	k = num // 3
	l = num // 3 + 1
	if num == 1:
		print('1', '0')
	if num == 2:
		print('0', '1')
	elif num > 3 and num % 3 != 0:
		if k + 2 * l == num:
			print(k, l)
		elif l + 2 * k == num:
			print(l, k)
	elif num >= 3 and num % 3 == 0:
		print(k, k)
	t -= 1


from itertools import islice
from string import Template
import sys
v = ['zero', 'one', 'two']

def solve(y):
	x = int(y)
	n = x // 3
	m = x % 3
	a = {'one': n, 'two': n, 'zero': 0}
	a[v[m]] += 1
	return Template('$one $two').substitute(a)
i = list(islice(sys.stdin.readlines(), 1, None))
print('\n'.join(list(map(solve, i))))


testcases = int(input())
while testcases > 0:
	n = int(input())
	c1 = n // 3
	c2 = n // 3
	if n % 3 == 1:
		c1 = c1 + 1
	if n % 3 == 2:
		c2 = c2 + 1
	x = [c1, c2]
	print(*x)
	testcases -= 1


for x in range(int(input())):
	n = int(input())
	x = n // 3 + (n % 3 == 1)
	y = n // 3 + (n % 3 == 2)
	print(x, ' ', y)


for _ in range(int(input())):
	n = int(input())
	if n % 3 == 0:
		(k1, k2) = (n // 3, n // 3)
	elif n % 3 == 1:
		(k1, k2) = (n // 3 + 1, n // 3)
	else:
		(k1, k2) = (n // 3, n // 3 + 1)
	print(k1, k2)


tt = int(input())
for _ in range(tt):
	n = int(input())
	if n % 3 == 0:
		print(int(n / 3), int(n / 3))
	elif n % 3 == 1:
		print(int(n / 3) + 1, int(n / 3))
	elif n % 3 == 2:
		print(int(n / 3), int(n / 3) + 1)


from collections import deque, defaultdict
from math import sqrt, ceil, factorial, floor, inf, log2, sqrt, gcd
import bisect
import copy
from itertools import combinations
import sys

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()

def f(a, b):
	res = b - a
	if res % 2 == 0:
		return res // 2
	return -1
for _ in range(int(input())):
	n = int(input())
	ans = n // 3
	mini = inf
	(x, y) = (-1, -1)
	for i in range(ans - 3, ans + 3):
		if i >= 0 and f(i, n) >= 0:
			if abs(i - f(i, n)) < mini:
				mini = abs(i - f(i, n))
				(x, y) = (i, f(i, n))
	print(x, y)


cases = int(input())
while cases > 0:
	cases -= 1
	n = int(input())
	c1 = n // 3 + 1 if n % 3 == 1 else n // 3
	c2 = n // 3 + 1 if n % 3 == 2 else n // 3
	print(c1, c2)


t = int(input())
for _ in range(t):
	n = int(input())
	c2 = n // 3
	c1 = n - c2 * 2
	if abs(c1 - c2) == 2:
		c1 -= 2
		c2 += 1
	print(c1, c2)


for i in range(int(input())):
	a = int(input())
	if a % 3 == 0:
		print(a // 3, a // 3)
	elif a % 3 == 1:
		print(a // 3 + 1, a // 3)
	else:
		print(a // 3, a // 3 + 1)


t = int(input())
for ert in range(t):
	n = int(input())
	e = n % 3
	if e == 1:
		print(n // 3 + 1, n // 3)
	elif e == 2:
		print(n // 3, n // 3 + 1)
	else:
		print(n // 3, n // 3)


t = int(input())
k = []
for i in range(t):
	n = int(input())
	if n % 3 == 0:
		k.append([n // 3, n // 3])
	elif n % 3 == 1:
		r = n - 1
		k.append([r // 3 + 1, r // 3])
	else:
		r = n - 2
		k.append([r // 3, r // 3 + 1])
for i in k:
	for j in i:
		print(j, end=' ')
	print('\n')


from sys import *
import math
input = stdin.readline
I = int
R = range
listInput = lambda : list(map(int, input().strip().split()))
lineInput = lambda : map(int, input().strip().split())
sJoin = lambda a, sep: '{}'.format(sep).join(a)
arrJoin = lambda a, sep: '{}'.format(sep).join(map(str, a))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	for i in range(5, int(math.sqrt(n) + 1), 6):
		if n % i == 0 or n % (i + 2) == 0:
			return False
	return True

def main():
	for k in R(I(input())):
		(n,) = lineInput()
		high = math.ceil(n / 3)
		low = n // 3
		if low + 2 * high == n:
			print(low, high)
		elif high + 2 * low == n:
			print(high, low)
main()


t = int(input())
for _ in range(t):
	n = int(input())
	ans = n // 3
	k = n % 3
	if k == 0:
		print(ans, ans)
	if k == 1:
		print(ans + 1, ans)
	if k == 2:
		print(ans, ans + 1)


n = int(input())
for i in range(n):
	a = int(input())
	t = a // 3
	if a % 3 == 1:
		print(t + 1, t)
	elif a % 3 == 2:
		print(t, t + 1)
	else:
		print(t, t)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
t = int(input())
for _ in range(t):
	n = int(input())
	x = n // 3
	y = n % 3
	if y == 0:
		print(x, x)
	elif y == 1:
		print(x + 1, x)
	else:
		print(x, x + 1)


import sys

def get_string():
	return sys.stdin.readline().strip()

def get_array():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def get_num():
	return int(sys.stdin.readline())
test = get_num()
for i in range(test):
	n = get_num()
	x = n // 3
	y = n // 3
	remaining = n - (2 * x + y)
	if remaining == 1:
		x += 1
	elif remaining == 2:
		y += 1
	print(x, y)


import math
t = int(input())
while t > 0:
	n = int(input())
	c = [0, 0]
	a = n % 3
	c[0] = n // 3
	c[1] = n // 3
	if a == 1:
		c[0] += 1
	elif a == 2:
		c[1] += 1
	print(*c, sep=' ')
	t -= 1


import math
for i in range(int(input())):
	n = int(input())
	c1 = math.ceil(n / 3)
	c2 = math.floor(n / 3)
	if c1 + 2 * c2 == n:
		print(c1, c2)
	else:
		print(c2, c1)


T = int(input())
for i in range(T):
	a = int(input())
	if a % 3 == 0:
		print(a // 3, a // 3)
	if a % 3 == 1:
		print(a // 3 + 1, a // 3)
	if a % 3 == 2:
		print(a // 3, a // 3 + 1)


def main():
	import sys
	input = sys.stdin.readline
	for _ in range(int(input())):
		n = int(input())
		x = n // 3
		if (n - x) % 2 == 0:
			y = (n - x) // 2
			print(x, y)
		else:
			y = n - 2 * x
			print(y, x)
main()


from sys import *
from math import floor
input = lambda : stdin.readline()
int_arr = lambda : list(map(int, stdin.readline().strip().split()))
str_arr = lambda : list(map(str, stdin.readline().split()))
get_str = lambda : map(str, stdin.readline().strip().split())
get_int = lambda : map(int, stdin.readline().strip().split())
get_float = lambda : map(float, stdin.readline().strip().split())
mod = 1000000007
setrecursionlimit(1000)
for _ in range(int(input())):
	n = int(input())
	val = floor(n / 3 + 0.5)
	print(n - 2 * val, val)


n = int(input())
for i in range(n):
	m = int(input())
	if m % 3 == 0:
		print(m // 3, m // 3)
	elif m % 3 == 1:
		print(m // 3 + 1, m // 3)
	else:
		print(m // 3, m // 3 + 1)


N = int(input())
ms = [int(input()) for i in range(N)]
for i in ms:
	c1 = i // 3
	c2 = i // 3
	ost1 = i % 3
	if ost1 == 0:
		print(c1, c2)
	else:
		if ost1 % 2 == 0:
			c2 += ost1 // 2
		else:
			c2 += ost1 // 2
			c1 += ost1 % 2
		print(c1, c2)


import sys

def process(a):
	if a % 3 == 0:
		return [int(a / 3), int(a / 3)]
	elif a % 3 == 1:
		return [int(a / 3) + 1, int(a / 3)]
	else:
		return [int(a / 3), int(a / 3) + 1]
t = int(input())
for i in range(t):
	a = int(input())
	sys.stdout.write(' '.join(map(str, process(a))) + '\n')


def solve(num):
	res = num // 3
	res = [res, res]
	if num % 3 == 1:
		res[0] += 1
	elif num % 3 == 2:
		res[1] += 1
	return res
t = int(input())
for ind in range(t):
	n = int(input())
	res = solve(n)
	res = map(str, res)
	print(' '.join(res))


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	c2 = round(n / 3)
	c1 = n - 2 * c2
	print(c1, c2)


for _ in range(int(input())):
	n = int(input())
	(a, m) = (n // 3, n % 3)
	if m == 0:
		print(a, a)
	elif m == 1:
		print(a + 1, a)
	else:
		print(a, a + 1)


import sys
import typing

def rl(proc=None) -> typing.Any:
	if proc is not None:
		return proc(sys.stdin.readline())
	else:
		return sys.stdin.readline().rstrip()

def srl(proc=None) -> typing.List[typing.Any]:
	if proc is not None:
		return list(map(proc, rl().split()))
	else:
		return rl().split()

def main():
	T = rl(int)
	for t in range(1, T + 1):
		N = rl(int)
		tot = N // 3
		left = N % 3
		if left == 0:
			print(tot, tot)
		elif left == 1:
			print(tot + 1, tot)
		else:
			print(tot, tot + 1)
main()


for _ in range(int(input())):
	n = int(input())
	two = n // 3
	one = n // 3
	rem = n % 3
	if rem != 0:
		if rem % 2 == 0:
			two += 1
		else:
			one += 1
	print(one, two)


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def inp():
	return input()

def sep():
	return map(int, input().split())

def inpu():
	return int(input())

def lis():
	return list(map(int, input().split()))
M = 10 ** 9 + 7

def main():
	t = 1
	t = inpu()
	for _ in range(t):
		n = inpu()
		if n % 3 == 0:
			print(n // 3, n // 3)
		else:
			c = n % 3
			if c == 1:
				print(n // 3 + 1, n // 3)
			else:
				print(n // 3, n // 3 + 1)
main()


t = int(input())
for i in range(t):
	n = int(input())
	remainder = n % 3
	if remainder == 0:
		print(n // 3, n // 3)
	elif remainder == 1:
		print(n // 3 + 1, n // 3)
	else:
		print(n // 3, n // 3 + 1)


t = int(input())
for _ in range(t):
	n = int(input())
	a = n // 3
	b = n // 3
	if n % 3 == 1:
		a += 1
	elif n % 3 == 2:
		b += 1
	print(a, b)


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	x = n // 3
	y = x
	if n % 3 == 1:
		x += 1
	elif n % 3 == 2:
		y += 1
	print(str(x) + ' ' + str(y))


import collections
import math
from heapq import *
import sys
from itertools import permutations
for _ in range(int(input())):
	n = int(input())
	out = n // 3
	ans = out
	val = n % 3
	if val == 1:
		ans += 1
	elif val == 2:
		out += 1
	print(ans, out)


t = int(input())
for case in range(t):
	n = int(input())
	c1 = n // 3
	if 3 * c1 == n:
		print(str(c1) + ' ' + str(c1))
	elif 3 * c1 + 1 == n:
		print(str(c1 + 1) + ' ' + str(c1))
	else:
		print(str(c1) + ' ' + str(c1 + 1))


t = int(input())
ans = []
for i in range(t):
	a = int(input())
	b = a - a // 3 * 3
	if b == 1:
		ans.append(a // 3 + 1)
		ans.append(a // 3)
	if b == 2:
		ans.append(a // 3)
		ans.append(a // 3 + 1)
	if b == 0:
		ans.append(a // 3)
		ans.append(a // 3)
for i in range(0, len(ans) - 1, 2):
	print(ans[i], ans[i + 1])


T = int(input())
for t in range(T):
	N = int(input())
	d3 = N // 3
	if N % 3 == 0:
		print(d3, d3)
	elif N % 3 == 1:
		print(d3 + 1, d3)
	else:
		print(d3, d3 + 1)


from math import ceil
for _ in range(int(input())):
	n = int(input())
	res = [ceil(n / 3), n // 3]
	if res[0] * 1 + res[1] * 2 == n:
		print(res[0], res[1])
	else:
		print(res[1], res[0])


t = int(input())
for i in range(t):
	n = int(input())
	c_1 = int(n / 3)
	c_2 = int(n / 3)
	if c_1 + 2 * c_2 == n:
		print(str(c_1) + ' ' + str(c_2))
	elif c_1 + 1 + 2 * c_2 == n:
		print(str(c_1 + 1) + ' ' + str(c_2))
	elif c_1 + 2 * (c_2 + 1) == n:
		print(str(c_1) + ' ' + str(c_2 + 1))


n = int(input())
l = []
for i in range(n):
	l.append(int(input()))

def coin(a):
	if a % 3 == 0:
		return [a // 3, a // 3]
	if a % 3 == 1:
		return [(a + 2) // 3, (a - 1) // 3]
	if a % 3 == 2:
		return [(a - 1) // 3, (a + 2) // 3]
for i in l:
	print(coin(i)[0], coin(i)[1])


for _ in range(int(input())):
	n = int(input())
	o = t = n // 3
	r = n % 3
	if r == 1:
		o += 1
	if r == 2:
		t += 1
	print(o, t)


def main():
	for i in range(int(input().rstrip())):
		n = int(input())
		x = []
		q = n // 3
		x.append(q)
		x.append(q)
		r = n % 3
		if r == 1:
			x[0] += 1
		if r == 2:
			x[1] += 1
		print(*x)
main()


import os, sys, math
from io import BytesIO, IOBase
from collections import defaultdict, deque, OrderedDict
import bisect as bi

def yes():
	print('YES')

def no():
	print('NO')

def I():
	return int(input())

def In():
	return map(int, input().split())

def ln():
	return list(map(int, input().split()))

def Sn():
	return input().strip()
BUFSIZE = 8192

def find_gt(a, x):
	i = bi.bisect_left(a, x)
	if i != len(a):
		return i
	else:
		return len(a)

def solve():
	n = I()
	(a, b) = (math.ceil(n / 3), n // 3)
	if a + 2 * b == n:
		print(a, b)
	else:
		print(b, a)
	pass

def main():
	T = I()
	for i in range(T):
		solve()
M = 998244353
P = 1000000007

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import sys

def calculate_minimum_difference(val):
	coin1 = val // 3
	coin2 = coin1
	if val - coin1 * 3 == 1:
		coin2 += 1
	elif val - coin1 * 3 == 2:
		coin1 += 1
	sys.stdout.write(f'{coin2} {coin1}\n')
infile = []
for line in sys.stdin:
	if '' == line.rstrip():
		break
	infile.append(int(line.rstrip()))
cases = infile[0]
for x in range(1, len(infile)):
	calculate_minimum_difference(infile[x])


import sys
input = sys.stdin.readline
output = sys.stdout.write

def main():
	tests = int(input().rstrip())
	for i in range(tests):
		ones = 0
		twos = 0
		num = int(input().rstrip())
		temp = num // 3
		dif = num % 3
		if dif == 1:
			ones += 1
		elif dif == 2:
			twos += 1
		ones += temp
		twos += temp
		output(str(ones) + ' ' + str(twos) + '\n')
main()


t = int(input())
for _ in range(t):
	n = int(input())
	a = n // 3
	left = n % 3
	if left == 0:
		print(a, a)
	elif left == 1:
		print(1 + a, a)
	else:
		print(a, a + 1)


for i in range(int(input())):
	x = int(input())
	y = x / 3
	if int(y) + int(y) * 2 != x:
		if (x - 1) % 3 == 0:
			print(int(y + 1), int(y))
		else:
			print(int(y), int(y + 1))
	else:
		print(int(y), int(y))


N = int(input())
for _ in range(N):
	n = int(input())
	c2 = n // 3 + (1 if 2 == n % 3 else 0)
	c1 = n - 2 * c2
	print(c1, c2)


o = []
for q in range(int(input())):
	n = int(input())
	a = n // 3
	n -= a
	if n % 2 == 0:
		b = int(n / 2)
	else:
		a += 1
		b = n // 2
	o.append([a, b])
for i in range(len(o)):
	print(str(o[i][0]) + ' ' + str(o[i][1]))


import sys
input = sys.stdin.readline

def S():
	return input()

def I():
	return int(S())

def M():
	return map(int, S().split())

def L():
	return list(M())
t = int(input())
for p in range(t):
	n = I()
	if n == 1:
		print(1, 0)
	elif n == 2:
		print(0, 1)
	else:
		a = n // 3
		b = n % 3
		if b == 0:
			print(a, a)
		elif b == 1:
			print(a + 1, a)
		else:
			print(a, a + 1)


import math
for _ in range(int(input())):
	n = int(input())
	m = n / 3
	if math.floor(m) + math.ceil(m) * 2 == n:
		print(math.floor(m), math.ceil(m))
	else:
		print(math.ceil(m), math.floor(m))


import sys
input = sys.stdin.readline
t = int(input())
for t in range(t):
	n = int(input())
	if n % 3 == 0:
		print(n // 3, n // 3)
	elif n % 3 == 1:
		print(n // 3 + 1, n // 3)
	else:
		print(n // 3, n // 3 + 1)


for a0 in range(int(input())):
	n = int(input())
	a = n % 3
	b = n // 3
	if a == 1:
		print(b + 1, b)
	elif a == 2:
		print(b, b + 1)
	else:
		print(b, b)


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def main():
	n = inp()
	for i in range(n):
		tc = inp()
		ans2 = round(tc / 3.0)
		ans1 = tc - 2 * ans2
		print(ans1, ans2)
main()


for t in range(int(input())):
	n = int(input())
	j1 = (n - 2) // 3
	j2 = (n + 2) // 3
	j3 = n // 3
	if j2 + (j2 - 1) * 2 == n:
		print(j2, j2 - 1)
	elif j2 + (j2 + 1) * 2 == n:
		print(j2, j2 + 1)
	elif j3 + j3 * 2 == n:
		print(j3, j3)
	elif j1 + (j1 + 1) * 2 == n:
		print(j1, j1 + 1)


for i in range(int(input())):
	n = int(input())
	if n % 3 == 0:
		print(int(n / 3), int(n / 3))
	else:
		c1 = round(n / 3)
		c2 = c1 - 1
		if c2 + 2 * c1 != n:
			c2 = c1 + 1
		print(c2, c1)


from functools import lru_cache
import copy
import math
import sys
fin = None
fout = None
uabet = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
abet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']

def start(filename):
	filename = filename.replace('.py', '')
	global fin
	global fout
	infile = filename + '.in'
	outfile = filename + '.out'
	fin = open(infile)
	fout = open(outfile, 'w')

def permutation(lst):
	if len(lst) == 0:
		return []
	if len(lst) == 1:
		return [lst]
	l = []
	for i in range(len(lst)):
		m = lst[i]
		remLst = lst[:i] + lst[i + 1:]
		for p in permutation(remLst):
			l.append([m] + p)
	return l

def subsets(x):
	retset = []
	if len(x) == 0:
		retset = [[]]
	else:
		first = x[-1]
		cop = x.copy()
		cop.remove(first)
		y = subsets(cop)
		retset.extend(copy.deepcopy(y))
		m = copy.deepcopy(y)
		for i in range(len(y)):
			k = m[0]
			m.remove(k)
			k.append(first)
			m.append(k)
		retset.extend(m.copy())
	return retset

class Point:

	def __init__(self, x, y):
		self.x = x
		self.y = y

	def __str__(self):
		return str(self.x) + str(self.y)

	def __hash__(self):
		return hash(str(self))

	def __eq__(self, other):
		return self.x == other.x and self.y == other.y

class frac:

	def __init__(self, n, d):
		self.n = n
		self.d = d

	def __str__(self):
		return str(self.n) + '/' + str(self.d)

	def __hash__(self):
		return hash(str(self))

	def simp(self):
		div = math.gcd(self.n, self.d)
		self.n = self.n / div
		self.d = self.d / div

	def __eq__(self, other):
		return self.n / self.d == other.n / other.d

	def __lt__(self, other):
		return self.n / self.d < other.n / other.d

class Interval:

	def __init__(self, start, end):
		self.start = start
		self.end = end

	def __str__(self):
		return str(self.start) + str(self.end)

	def __hash__(self):
		return hash(str(self))

	def __eq__(self, other):
		return self.start == other.start and self.end == other.end

	def __lt__(self, other):
		return self.start < other.start

class Graph:

	def __init__(self, vertices):
		self.V = vertices
		self.graph = [[0 for column in range(vertices)] for row in range(vertices)]

	def minDistance(self, dist, sptSet):
		min = sys.maxsize
		min_index = -1
		for v in range(self.V):
			if dist[v] < min and sptSet[v] == False:
				min = dist[v]
				min_index = v
		if min_index == -1:
			for v in range(self.V):
				if not sptSet[v]:
					min_index = v
					break
		return min_index

	def dijkstra(self, src):
		dist = [sys.maxsize] * self.V
		dist[src] = 0
		sptSet = [False] * self.V
		for cout in range(self.V):
			u = self.minDistance(dist, sptSet)
			sptSet[u] = True
			for v in range(self.V):
				if self.graph[u][v] > 0 and sptSet[v] == False and (dist[v] > dist[u] + self.graph[u][v]):
					dist[v] = dist[u] + self.graph[u][v]
		return dist

def overlap(verl1, verl2):
	if verl1.end >= verl2.start:
		return True
	else:
		return False

def merge(verl1, verl2):
	retverl = Interval(min(verl1.start, verl2.start), max(verl1.end, verl2.end))
	return retverl

def changeBase(num, base):
	if base == 2:
		return '{0:b}'.format(num)
	power = math.floor(math.log(num, base))
	remainder = num
	end = []
	iter = list(range(power + 1))
	iter.reverse()
	for i in iter:
		if remainder >= base ** i:
			(q, r) = divmod(remainder, base ** i)
			end.append(q)
			remainder = r
		else:
			end.append(0)
	retlist = []
	for i in end:
		if i > 9:
			retlist.append(uabet[i - 10])
		else:
			retlist.append(i)
	retlist = map(str, retlist)
	return ''.join(retlist)

def prime(num):
	if num == 2:
		return True
	if num % 2 == 0:
		return False
	for i in range(2, math.ceil(num ** 0.5) + 1):
		if num % i == 0:
			return False
	return True

def solve(n):
	if n % 3 == 0:
		x = n // 3
		return str(x) + ' ' + str(x)
	if n % 3 == 1:
		x = n // 3
		return str(x + 1) + ' ' + str(x)
	if n % 3 == 2:
		x = n // 3
		return str(x) + ' ' + str(x + 1)

def main():
	t = int(input())
	for i in range(t):
		n = int(input())
		print(solve(n))
main()


t = int(input())
for i in range(t):
	n = int(input())
	d = n // 3
	r = n % 3
	if r == 2:
		print(d, d + 1)
	elif r == 1:
		print(d + 1, d)
	else:
		print(d, d)


t = int(input())
natija = []
for i in range(t):
	n = int(input())
	c1 = n // 3
	c2 = n // 3
	if n - 3 * c1 == 1:
		c1 += 1
	elif n - 3 * c1 == 2:
		c2 += 1
	natija.append(str(c1) + ' ' + str(c2))
for i in range(t):
	print(natija[i])


import math
t = int(input())
while t > 0:
	n = int(input())
	c2 = n // 3
	c1 = (n - c2) // 2
	if c1 + 2 * c2 == n:
		if c1 > c2:
			c1 = math.ceil(c1)
			c2 = int(c2)
		else:
			c2 = math.ceil(c2)
			c1 = int(c1)
		print(c1, c2)
	elif c2 + 2 * c1 == n:
		if c2 > c1:
			c1 = math.ceil(c1)
		else:
			c2 = math.ceil(c2)
		print(c2, c1)
	elif c1 + 1 + 2 * c2 == n:
		c1 = c1 + 1
		print(c1, c2)
	elif c1 + 2 * (c2 + 1) == n:
		c2 = c2 + 1
		print(c1, c2)
	t = t - 1


t = int(input())
for _ in range(t):
	n = int(input())
	print(n // 3 + (n % 3 == 1), n // 3 + (n % 3 == 2))


try:
	T = int(input())
	for i in range(T):
		n = int(input())
		if n == 0:
			print(0, 0)
		elif n == 1:
			print(1, 0)
		elif n == 2:
			print(0, 1)
		else:
			x = n // 3
			if x + x + x == n:
				print(x, x)
			else:
				y = n - (x + x + x)
				if y == 1:
					print(x + 1, x)
				else:
					print(x, x + 1)
except:
	pass


for _ in range(int(input())):
	n = int(input())
	x = n // 3
	if n % 3 == 0:
		print(x, x)
	elif n % 3 == 1:
		print(x + 1, x)
	else:
		print(x, x + 1)


for _ in range(int(input())):
	n = int(input())
	c1 = n // 3
	c2 = (n - c1) * 2
	t = c1 + c2 * 2
	if t != n:
		c2 += (n - t) // 2
		c1 += (n - t) % 2
	ch = str(c1) + ' ' + str(c2)
	print(ch)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	x = n // 3
	y = n % 3
	(c1, c2) = (x, x)
	if y == 1:
		c1 += 1
	elif y == 2:
		c2 += 1
	print(c1, c2)


def solve(n):
	for _ in range(n):
		x = int(input())
		c1 = x // 3
		b1 = x - 2 * c1
		c2 = c1 + 1
		b2 = x - 2 * c2
		if abs(c1 - b1) < abs(c2 - b2):
			print(b1, c1)
		else:
			print(b2, c2)

def main():
	n = int(input())
	solve(n)
main()


import sys
import math
import collections
import heapq
import decimal
input = sys.stdin.readline
t = int(input())
for w in range(t):
	n = int(input())
	if n % 3 == 0:
		print(n // 3, n // 3)
	elif n % 3 == 1:
		print(n // 3 + 1, n // 3)
	else:
		print(n // 3, n // 3 + 1)


from math import ceil
t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0:
		X = ceil(n / 3)
		P = n - X
		if P % 2 == 0:
			Q = P // 2
			print(X, Q)
		else:
			c1 = X + 1
			c2 = P // 2
			c3 = X - 1
			c4 = P // 2 + 1
			A = abs(c1 - c2)
			B = abs(c3 - c4)
			if A > B:
				print(c3, c4)
			else:
				print(c1, c2)
	else:
		X = ceil(n / 3)
		P = n - X
		if P % 2 == 0:
			Q = P // 2
			print(X, Q)
		else:
			c1 = X + 1
			c2 = P // 2
			c3 = X - 1
			c4 = P // 2 + 1
			A = abs(c1 - c2)
			B = abs(c3 - c4)
			if A > B:
				print(c3, c4)
			else:
				print(c1, c2)


t = int(input())
s_1 = s_2 = 0
for i in range(t):
	N = int(input())
	s = N // 3
	r = N % 3
	s_2 = s
	if r >= 2:
		s_2 = s + r // 2
		r = r % 2
	s_1 = s + r
	print(f'{s_1} {s_2}')


for j in range(int(input())):
	n = int(input())
	a = n // 3
	b = n // 3
	if abs(a + 2 * b - n) == 2:
		print(a, b + 1)
	elif abs(a + 2 * b - n) == 1:
		print(a + 1, b)
	else:
		print(a, b)


n = int(input())
for i in range(n):
	ans = int(input())
	if ans % 3 == 0:
		c1 = ans // 3
		c2 = ans // 3
	elif (ans - 1) % 3 == 0:
		c1 = (ans - 1) // 3
		c2 = c1 + 1
	elif (ans - 2) % 3 == 0:
		c2 = (ans - 2) // 3
		c1 = c2 + 1
	print('{} {}'.format(c2, c1))


t = int(input())
for i in range(t):
	amount = int(input())
	if amount % 3 == 0:
		print(str(amount // 3) + ' ' + str(amount // 3))
	elif amount % 3 == 1:
		print(str((amount - 1) // 3 + 1) + ' ' + str((amount - 1) // 3))
	else:
		print(str((amount - 2) // 3) + ' ' + str((amount - 2) // 3 + 1))


for _ in range(int(input())):
	n = int(input())
	a1 = a2 = n // 3
	if n % 3 == 0:
		print(a1, a2)
	elif n % 3 == 1:
		print(a1 + 1, a2)
	else:
		print(a1, a2 + 1)


from math import *
for _ in range(int(input())):
	n = int(input())
	if n % 3 == 0:
		print(n // 3, n // 3)
	else:
		a = ceil(n / 3)
		x1 = a
		x2 = a - 1
		if x1 + 2 * x2 == n:
			print(x1, x2)
		else:
			print(x2, x1)


import math as mt
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 3 == 0:
		print(n // 3, n // 3)
	elif n % 3 == 2:
		print(n // 3, n // 3 + 1)
	else:
		print(n // 3 + 1, n // 3)


t = int(input())
while t > 0:
	n = int(input())
	if n % 3 == 0:
		print(n // 3, n // 3)
	elif n % 3 == 1:
		print(n // 3 + 1, n // 3)
	else:
		print(n // 3, n // 3 + 1)
	t = t - 1


import sys
import math
input = sys.stdin.readline
from itertools import permutations
from collections import Counter
t = int(input())
for _ in range(t):
	n = int(input())
	div = math.ceil(2 / 3 * n)
	offset = 0
	if div % 2 != 0:
		offset = 1
	two = div // 2
	one = n - div
	print(one + offset, two)


ttt_ = int(input())
for __t in range(ttt_):
	n = int(input())
	m = n % 3
	k = n // 3
	(c1, c2) = (k, k)
	if m == 1:
		c1 += 1
	elif m == 2:
		c2 += 1
	print(c1, c2)


import sys, math
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
mod = 10 ** 9 + 7
input = lambda : sys.stdin.readline().rstrip()

def li():
	return list(map(int, input().split()))
t = int(input())
for _ in range(t):
	n = int(input())
	a = n // 3
	b = n // 3
	if n % 3 == 2:
		b += 1
	elif n % 3 == 1:
		a += 1
	print(a, b)


t = int(input())
while t:
	n = int(input())
	ans = n // 3
	if ans * 2 + ans == n:
		print(ans, ans)
	elif ans * 2 + ans + 1 == n:
		print(ans + 1, ans)
	else:
		print(ans, ans + 1)
	t -= 1


import math

def solve(n):
	p = n / 3
	k = math.ceil(p)
	t = math.floor(p)
	if k + 2 * t == n:
		return [k, t]
	else:
		return [t, k]
n = int(input())
for i in range(n):
	k = int(input())
	res = solve(k)
	print(*res)


from math import ceil
t = int(input())
for i in range(t):
	n = int(input())
	(x1, x2) = (n // 3, ceil(n / 3))
	if not x1 + 2 * x2 == n:
		(x1, x2) = (x2, x1)
	print(x1, x2)


time = int(input())
i = int(1)
while i <= time:
	m = float(input())
	a = m / 3
	if a - int(a) == 0:
		print(int(a), int(a))
	elif a - int(a) < 0.5:
		print(int(a) + 1, int(a))
	else:
		print(int(a), int(a) + 1)
	i = i + 1


def solve():
	n = int(input())
	if n % 3 == 0:
		return str(n // 3) + ' ' + str(n // 3)
	if n % 3 == 1:
		return str(n // 3 + 1) + ' ' + str(n // 3)
	return str(n // 3) + ' ' + str(n // 3 + 1)
t = int(input())
ans = []
while t:
	ans.append(str(solve()))
	t -= 1
print('\n'.join(ans))


from sys import stdin, stdout
import sys, heapq, io, os
from collections import defaultdict as D
from collections import deque
import math

def II():
	return map(int, input().split())

def Ii():
	return int(input())

def infi():
	return float('Inf')

def mino():
	return -1
for __ in range(Ii()):
	n = Ii()
	o = 0
	r = n // 3
	t = r
	o = r
	s = o + t * 2
	r = n - s
	if r == 1:
		o += 1
	if r == 2:
		t += 1
	print(o, t)


t = int(input())
(a, s) = ([], [])
for i in range(t):
	c = 0
	n = int(input())
	a.append(n)
	if len(a) > 0:
		if a[0] // 3 + a[0] // 3 * 2 == a[0]:
			c += a[0] // 3
			s.append(str(c) + ' ' + str(c))
			del a[0]
			continue
		elif a[0] // 3 + 1 + a[0] // 3 * 2 == a[0]:
			c += a[0] // 3 + 1
			s.append(str(c) + ' ' + str(c - 1))
			del a[0]
			continue
		else:
			c += a[0] // 3 + 1
			s.append(str(c - 1) + ' ' + str(c))
			del a[0]
			continue
	else:
		break
print(*s, sep='\n')


t = int(input())
costs = []
for _ in range(t):
	costs.append(int(input()))
for cost in costs:
	one_bur = cost // 3
	two_bur = (cost - one_bur) // 2
	counter = 0
	dif = cost - (one_bur + two_bur * 2)
	if dif == 1:
		one_bur += 1
	elif dif == 2:
		two_bur += 1
	print(f'{one_bur} {two_bur}')


from os import sep
answer = []
t = int(input())
for i in range(0, t):
	n = int(input())
	if n % 3 == 0:
		c1 = int(n / 3)
		c2 = int(n / 3)
	elif n % 3 == 1:
		c2 = int((n - 1) / 3)
		c1 = c2 + 1
	else:
		c1 = int((n - 2) / 3)
		c2 = c1 + 1
	arr = [c1, c2]
	answer.append(arr)
for j in range(0, len(answer)):
	print(*answer[j], sep=' ')


for _ in range(int(input())):
	n = int(input())
	a = round(n / 3)
	val = a * 2
	val2 = n - val
	print(val2, a)


n = int(input())
for i in range(n):
	m = int(input())
	div = m / 3
	remi = m % 3
	if remi == 1:
		print(int(div + remi), int(div))
	elif remi == 2:
		print(int(div), int(div + 1))
	else:
		print(int(div), int(div))


c = int(input())
while c != 0:
	n = int(input())
	if n % 3 == 0:
		print(int(n / 3), int(n / 3))
	elif n % 3 == 1:
		print(int(n / 3) + 1, int(n / 3))
	else:
		print(int(n / 3), int(n / 3) + 1)
	c -= 1


t = int(input())
a = [0] * t
for i in range(t):
	a[i] = int(input())
for i in range(t):
	if a[i] % 3 == 0:
		c2 = a[i] // 3
		c1 = c2
	else:
		c2 = a[i] // 3
		c1 = c2 + 1
	if c1 + 2 * c2 != a[i]:
		c2 = a[i] // 3 + 1
		c1 = c2 - 1
	print(c1, c2)


def solve(a):
	res = [a // 3, a // 3]
	if (a // 3 * 3 - a) % 3 == 1:
		res[1] += 1
	if (a // 3 * 3 - a) % 3 == 2:
		res[0] += 1
	return f'{res[0]} {res[1]}'
num = input()
for n in range(int(num)):
	print(solve(int(input())))


for _ in range(int(input())):
	n = int(input())
	a = n // 3
	b = n - 2 * n // 3
	if a + 2 * b == n:
		print(a, b)
	else:
		print(b, a)


from collections import defaultdict as dd
import math
import sys
input = sys.stdin.readline

def nn():
	return int(input())

def li():
	return list(input())

def mi():
	return map(int, input().split())

def lm():
	return list(map(int, input().split()))

def solve():
	v = nn()
	ones = v // 3
	twos = v // 3
	if v % 3 == 1:
		ones += 1
	elif v % 3 == 2:
		twos += 1
	print(ones, twos)
q = nn()
for _ in range(q):
	solve()


import sys
input = sys.stdin.readline
ins = lambda : input().rstrip()
ini = lambda : int(input().rstrip())
inm = lambda : map(int, input().rstrip().split())
inl = lambda : list(map(int, input().split()))
out = lambda x, s='\n': print(s.join(map(str, x)))
t = ini()
for _ in range(t):
	n = ini()
	x = n // 3
	if n % 3:
		if x + x * 2 + 1 == n:
			print(x + 1, x)
		else:
			print(x, x + 1)
	else:
		print(x, x)


t = int(input())
for i in range(t):
	n = int(input())
	if n % 3 == 0:
		print(n // 3, n // 3)
	elif n % 3 == 1:
		print(n // 3 + 1, n // 3)
	elif n % 3 == 2:
		print(n // 3, n // 3 + 1)


x = int(input())
y = 0
for _ in range(x):
	s = int(input())
	if s / 3 > s // 3 + 0.5:
		y = s // 3 + 1
	else:
		y = s // 3
	x = s - 2 * y
	print(x, y)


import math
for _ in range(int(input())):
	n = int(input())
	c_1 = n // 3 if n % 3 != 1 else n // 3 + 1
	c_2 = n // 3 if n % 3 != 2 else n // 3 + 1
	print(c_1, c_2)


def main():
	for _ in range(int(input())):
		n = int(input())
		m = n // 3
		if n % 3 == 0:
			print(m, m)
		elif n % 3 == 1:
			print(m + 1, m)
		elif n % 3 == 2:
			print(m, m + 1)
main()


import bisect
import math
import collections
import sys
import copy
from functools import reduce
import decimal
sys.setrecursionlimit(10 ** 9)
decimal.getcontext().rounding = decimal.ROUND_HALF_UP
graphDict = collections.defaultdict
queue = collections.deque

class Graphs:

	def __init__(self):
		self.graph = graphDict(list)

	def add_edge(self, u, v):
		self.graph[u].append(v)

	def dfs_utility(self, nodes, visited_nodes):
		visited_nodes.add(nodes)
		for neighbour in self.graph[nodes]:
			if neighbour not in visited_nodes:
				self.dfs_utility(neighbour, visited_nodes)
			else:
				return neighbour

	def dfs(self, node):
		Visited = set()
		self.dfs_utility(node, Visited)

	def bfs(self, node):
		visited = set()
		if node not in visited:
			queue.append(node)
			visited.add(node)
		while queue:
			parent = queue.popleft()
			print(parent)
			for item in self.graph[parent]:
				if item not in visited:
					queue.append(item)
					visited.add(item)

def rounding(n):
	return int(decimal.Decimal(f'{n}').to_integral_value())

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def inp():
	return sys.stdin.readline().strip()

def map_inp(v_type):
	return map(v_type, inp().split())

def list_inp(v_type):
	return list(map_inp(v_type))
for _ in range(int(inp())):
	n = int(inp())
	(a, b) = (n // 3, n // 3)
	if n % 3 == 1:
		a += 1
	if n % 3 == 2:
		b += 1
	print(a, b)


t = int(input())
for dummy_i in range(t):
	num = int(input())
	n1 = num // 3
	n2 = num // 3
	if num % 3 == 1:
		n1 += 1
	elif num % 3 == 2:
		n2 += 1
	print(str(n1) + ' ' + str(n2))


import queue
from math import *
import sys
from collections import *
from random import *
from itertools import *
sys.setrecursionlimit(99999)
eps = sys.float_info.epsilon
P = 2
INF = 1000000000.0 + 1
MOD = 1000000007

def is_prime(n):
	if n == 0 or n == 1:
		return False
	d = 2
	while d * d <= n:
		if n % d == 0:
			return False
		d += 1
	return True

def div_up(n, k):
	if n % k == 0:
		return n // k
	else:
		return n // k + 1

def num_len(n, base=10):
	if n == 0:
		return 1
	return int(floor(log(n, base) + 1))

def dfs_sample(graph, cl, p, v):
	cl[v] = 1
	for to in graph[v]:
		if cl[to] == 1 and p[v] != to:
			pass
		elif cl[to] == 0:
			p[to] = v
			dfs_sample(graph, cl, p, to)
	cl[v] = 2

def down(a):
	for i in range(1, len(a)):
		if a[i] > a[i - 1]:
			return False
	return True

def up(a):
	for i in range(1, len(a)):
		if a[i] < a[i - 1]:
			return False
	return True

def code(c):
	return ord(c) - 32

def _hash_(s):
	(res, p) = (0, 1)
	for i in range(len(s)):
		res += code(s[i]) * p
		res %= MOD
		p *= P
		p %= MOD
	return res % MOD

def remove_edge(v, u, graph):
	graph[v].remove(u)
	graph[u].remove(v)

def dfs_stack(start, graph, visited, flags):
	global b
	stack = []
	visited[start] = True
	stack.append(start)
	while len(stack) != 0:
		v = stack.pop()
		if not flags[v]:
			b = False
		for to in graph[v]:
			if not visited[to]:
				visited[to] = True
				stack.append(to)

def all_eq(a):
	for i in range(len(a) - 1):
		if a[i] != a[i + 1]:
			return False
	return True

def solve():
	n = int(input())
	if n % 3 == 0:
		print(n // 3, n // 3)
	elif n % 3 == 2:
		print(n // 3, n // 3 + 1)
	else:
		print(n // 3 + 1, n // 3)
for _ in range(int(input())):
	solve()

def debug():
	pass


for i in range(int(input())):
	num = int(input())
	third_part = num // 3
	remainder = num % 3
	(c1, c2) = (third_part, third_part)
	if remainder == 2:
		c2 += 1
	elif remainder == 1:
		c1 += 1
	print(c1, c2)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	print(n // 3 + (n % 3 == 1), n // 3 + (n % 3 == 2))


t = int(input())
for k in range(t):
	n = int(input())
	d1 = d2 = 0
	q = n // 3
	d1 = d2 = q
	rem = n % 3
	if rem == 1:
		d1 += 1
	elif rem == 2:
		d2 += 1
	print(d1, d2)


t = int(input())
for _ in range(t):
	n = int(input())
	(x, y) = (n - 2 * (n // 3), n // 3)
	(p, q) = (n - 2 * (n // 3 + 1), n // 3 + 1)
	if abs(p - q) < abs(x - y):
		print(p, q)
	else:
		print(x, y)


t = int(input())
for i in range(t):
	n = int(input())
	c1 = n // 3
	if n % 3 == 0:
		c2 = c1
	else:
		c2 = c1 + 1
	if c1 * 1 + c2 * 2 == n:
		print(c1, c2, sep=' ')
	elif c2 * 1 + c1 * 2 == n:
		print(c2, c1, sep=' ')


import math
t = int(input())
while t > 0:
	n = int(input())
	if n % 3 == 2:
		print(str(math.floor(n / 3)), str(math.ceil(n / 3)))
	elif n % 3 == 1:
		print(str(math.ceil(n / 3)), str(math.floor(n / 3)))
	else:
		print(str(int(n / 3)), str(int(n / 3)))
	t = t - 1


def coins(n):
	c = n // 3
	if n % 3 == 0:
		return (c, c)
	if n % 3 == 1:
		return (c + 1, c)
	if n % 3 == 2:
		return (c, c + 1)

def main():
	outputs = []
	N = int(input())
	for _ in range(N):
		n = int(input())
		outputs.append(coins(n))
	print('\n'.join([f'{c_1} {c_2}' for (c_1, c_2) in outputs]))
main()


for _ in range(int(input())):
	data = int(input())
	if data == 1:
		print('1 0')
	elif data == 2:
		print('0 1')
	else:
		x = data // 3
		if x + 2 * x == data:
			print(x, x)
		elif data % 3 == 1:
			print(x + 1, x)
		else:
			print(x, x + 1)


import time
from ast import Try
from io import BytesIO, IOBase
import math
import sys
import os
from math import gcd, floor, sqrt, log
input: lambda : sys.stdin.readline().rstrip()
start_time = time.time()

def iin():
	return int(input())

def sin():
	return input().strip()

def listin():
	return list(map(int, input().strip().split()))

def liststr():
	return list(map(str, input().strip().split()))

def ceill(x):
	return int(x) if x == int(x) else int(x) + 1

def ceilldiv(x, d):
	return x // d if x % d == 0 else x // d + 1

def LCM(a, b):
	return a * b // gcd(a, b)

def solve():
	n = iin()
	k = n // 3
	l = k
	if n % 3 == 1:
		k += 1
	elif n % 3 == 2:
		l += 1
	print(k, l)
ttt = 1
ttt = iin()
for hula in range(ttt):
	solve()


t = int(input())
while t:
	t -= 1
	n = int(input())
	print(n // 3 + (1 if n % 3 == 1 else 0), n // 3 + (1 if n % 3 == 2 else 0))


for _ in range(int(input().strip())):
	total = int(input().strip())
	two = total // 3
	one = total // 3
	rem = total % 3
	if rem == 1:
		one += 1
	elif rem == 2:
		two += 1
	print(one, two)


n = int(input())
for _ in range(n):
	t = int(input())
	r1 = t // 3
	r2 = t // 3
	if t % 3 == 1:
		r1 += 1
	elif t % 3 == 2:
		r2 += 1
	print(str(r1) + ' ' + str(r2))


def calculate(n):
	d1 = n % 3
	d2 = 3 - d1
	y1 = n // 3
	y2 = y1 + 1
	x1 = y1 + d1
	x2 = y2 - d2
	if abs(x1 - y1) < abs(x2 - y2):
		return str(x1) + ' ' + str(y1)
	return str(x2) + ' ' + str(y2)

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		print(calculate(n))
main()


n = int(input())
for i in range(n):
	x = int(input())
	y = x // 3
	z = (x - y) // 2
	if z * 2 + y != x:
		y += 1
	print(y, z)


from bisect import insort, bisect_right, bisect_left
from sys import stdout, stdin, setrecursionlimit
from heapq import heappush, heappop, heapify
from io import BytesIO, IOBase
from collections import *
from itertools import *
from random import *
from string import *
from queue import *
from math import *
from re import *
from os import *

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = read(self._fd, max(fstat(self._fd).st_size, 8192))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = read(self._fd, max(fstat(self._fd).st_size, 8192))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(stdin, stdout) = (IOWrapper(stdin), IOWrapper(stdout))
(graph, mod, szzz) = ({}, 10 ** 9 + 7, lambda : sorted(zzz()))

def getStr():
	return input()

def getInt():
	return int(input())

def listStr():
	return list(input())

def getStrs():
	return input().split()

def isInt(s):
	return '0' <= s[0] <= '9'

def input():
	return stdin.readline().strip()

def zzz():
	return [int(i) for i in input().split()]

def output(answer, end='\n'):
	stdout.write(str(answer) + end)

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def getPrimes(N=10 ** 5):
	SN = int(sqrt(N))
	sieve = [i for i in range(N + 1)]
	sieve[1] = 0
	for i in sieve:
		if i > SN:
			break
		if i == 0:
			continue
		for j in range(2 * i, N + 1, i):
			sieve[j] = 0
	prime = [i for i in range(N + 1) if sieve[i] != 0]
	return prime

def primeFactor(n, prime=getPrimes()):
	lst = []
	mx = int(sqrt(n)) + 1
	for i in prime:
		if i > mx:
			break
		while n % i == 0:
			lst.append(i)
			n //= i
	if n > 1:
		lst.append(n)
	return lst
dx = [-1, 1, 0, 0, 1, -1, 1, -1]
dy = [0, 0, 1, -1, 1, -1, -1, 1]
daysInMounth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
num = getInt()
for _ in range(num):
	n = getInt()
	ans1 = n // 3
	ans2 = n - ans1
	if ans2 % 2:
		ans1 += 1
	ans2 = ans2 // 2
	print(ans1, ans2)


t = int(input())
for _ in range(t):
	n = int(input())
	c2 = round(n / 3)
	c1 = n - 2 * c2
	print(c1, c2)


from sys import stdin

def solve():
	n = int(stdin.readline().strip())
	c = n // 3
	if n % 3 == 0:
		print(str(c) + ' ' + str(c))
	elif n % 3 == 1:
		print(str(c + 1) + ' ' + str(c))
	else:
		print(str(c) + ' ' + str(c + 1))
t = int(stdin.readline().strip())
for _ in range(t):
	solve()


import os
import sys
import math
import collections
import functools
import itertools
import heapq
import bisect
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ALPHA = 'abcde'
MOD = 10 ** 9 + 7
EPS = 1e-06

def Ceil(a, b):
	return a // b + int(a % b > 0)

def INT():
	return int(input())

def STR():
	return input()

def INTs():
	return tuple(map(int, input().split()))

def ARRINT():
	return [int(i) for i in input().split()]

def ARRSTR():
	return [i for i in input().split()]
for _ in range(INT()):
	n = INT()
	(a, b) = divmod(n, 3)
	if b == 0:
		print(a, a)
	elif b == 1:
		print(a + 1, a)
	else:
		print(a, a + 1)


t = int(input())
for i in range(t):
	n = int(input())
	a = n // 3
	if a + 2 * a == n:
		print(a, end=' ')
		print(a)
	else:
		b = n % 3
		if b == 1:
			print(a + 1, end=' ')
			print(a)
		else:
			print(a, end=' ')
			print(a + 1)


for t in range(int(input())):
	n = int(input())
	c1 = 0
	c2 = 0
	k = n % 3
	p = (n - k) // 3
	c1 = p
	c2 = p
	if k == 1:
		c1 += 1
	elif k == 2:
		c2 += 1
	print(c1, c2)


TestCases = int(input(''))
Results = []
Counter = 0

def solve(case):
	if case % 3 == 0:
		Results.append(int(case / 3))
		Results.append(int(case / 3))
	else:
		Value1 = int(case / 2 / 1.5)
		Value2 = Value1 + 1
		if Value1 + Value2 * 2 == case:
			Results.append(Value1)
			Results.append(Value2)
		else:
			Results.append(Value2)
			Results.append(Value1)
for c in range(TestCases):
	case = int(input(''))
	solve(case)
for c in Results:
	print(c, end=' ')
	Counter += 1
	if Counter == 2:
		print('')
		Counter = 0


for s in [*open(0)][1:]:
	s = int(s)
	print(f'{s - s // 3 * 2} {s // 3}' if s % 3 <= 1 else f'{s - s // 3 * 2 - 2} {s // 3 + 1}')


t = int(input())
for i in range(t):
	n = int(input())
	c1 = n // 3 + 1
	c2 = n // 3
	if n % 3 == 0:
		c1 = c1 - 1
	a = c1 + 2 * c2
	if a != n:
		c1 = c1 - 1
		c2 = c2 + 1
	else:
		pass
	a = c1 + 2 * c2
	if a == n and abs(c1 - c2) >= 0:
		print(c1, c2)


for _ in range(int(input())):
	n = int(input())
	ek_taka = n // 3
	dui_taka = ek_taka
	if n % 3 == 1:
		ek_taka += 1
	elif n % 3 == 2:
		dui_taka += 1
	print(ek_taka, dui_taka)


for i in range(int(input())):
	n = int(input())
	q = n // 3
	r = n % 3
	if r == 0:
		print(q, q)
	elif r == 1:
		print(q + 1, q)
	else:
		print(q, q + 1)


for _ in range(int(input())):
	n = int(input())
	p = n // 3
	if n % 3 == 2:
		print(p, p + 1)
	else:
		print(p + n % 3, p)


test_cases = int(input())
for i in range(test_cases):
	number = int(input())
	remainder = number // 3
	out = number % 3
	if not out:
		print(remainder, remainder)
	elif out == 1:
		print(remainder + 1, remainder)
	else:
		print(remainder, remainder + 1)


def solution(n):
	c1 = 0
	c2 = 0
	if n % 3 == 1:
		c1 += 1
	if n % 3 == 2:
		c2 += 1
	c1 += n // 3
	c2 += n // 3
	return ' '.join(list(map(str, [c1, c2])))
result = []
t = int(input())
for _ in range(t):
	n = int(input())
	result.append(solution(n))
print(*result, sep='\n')


def work(n):
	a = b = n // 3
	if n % 3 != 0:
		x = n % 3
		b += x // 2
		a += x % 2
	print(a, b)
for _ in range(int(input())):
	work(int(input()))


k = int(input())
n = []
for i in range(k):
	n.append(int(input()))
for i in range(k):
	if n[i] % 3 == 0:
		c1 = n[i] // 3
		c2 = c1
	else:
		n[i] -= 1
		if n[i] % 3 == 0:
			temp = n[i] // 3
			c1 = temp + 1
			c2 = temp
		else:
			n[i] -= 1
			temp = n[i] // 3
			c1 = temp
			c2 = temp + 1
	print(c1, c2)


import math
t = int(input())
for i in range(t):
	n = int(input())
	if n % 3 == 0:
		print(n // 3, n // 3)
	elif n % 3 == 1:
		c2 = math.floor(n / 3)
		c1 = n - 2 * c2
		print(c1, c2)
	else:
		c2 = math.ceil(n / 3)
		c1 = n - 2 * c2
		print(c1, c2)


test = int(input())
values = []
for i in range(0, test):
	a = int(input())
	values.append(a)
c1 = 1
c2 = 2
number_c1 = 0
number_c2 = 0
for value in values:
	if value % 3 == 0:
		c1 = c2 = value / 3
	elif (value - 1) % 3 == 0:
		c2 = (value - 1) / 3
		c1 = c2 + 1
	elif (value - 2) % 3 == 0:
		c1 = (value - 2) / 3
		c2 = c1 + 1
	else:
		pass
	print(f'{int(c1)} {int(c2)}')


tt = int(input())
for j in range(tt):
	n = int(input())
	x = round(n / 3)
	res = n - 2 * x
	print(res, x)


nums = []
n = int(input())
for i in range(n):
	num = int(input())
	nums.append(num)
for j in nums:
	x = j // 3
	y = j % 3
	if y == 0:
		print(x, x)
	elif y == 1:
		print(x + 1, x)
	else:
		print(x, x + 1)


tt = int(input())
qu = []
for t in range(tt):
	qu.append(int(input()))
for q in qu:
	c = q // 3
	r = q % 3
	if r == 1:
		print(c + 1, c)
	elif r == 2:
		print(c, c + 1)
	else:
		print(c, c)


test = int(input())
for t in range(test):
	n = int(input())
	c1 = n // 3
	c2 = (n - c1) // 2
	if (n - c1) % 2 != 0:
		c2 += 1
	if c1 + 2 * c2 == n:
		print(c1, c2)
	else:
		print(c2, c1)


for _ in range(int(input())):
	t = int(input())
	tmp = t // 3
	if t - tmp * 3 == 1:
		print(tmp + 1, tmp)
	elif t - tmp * 3 == 2:
		print(tmp, tmp + 1)
	else:
		print(tmp, tmp)


for _ in range(int(input())):
	n = int(input())
	if n % 3 == 0:
		print(int(n / 3), int(n / 3))
	else:
		x = int(n / 3)
		while int((n - x) / 2) != (n - x) / 2:
			x += 1
		print(x, int((n - x) / 2))


import math
for _ in range(int(input())):
	n = int(input())
	x = n // 3
	xx = math.ceil(n / 3)
	y = n - 2 * x
	yy = n - 2 * xx
	if yy >= 0 and xx >= 0 and (abs(y - x) > abs(yy - xx)):
		print(yy, xx)
	else:
		print(y, x)


for _ in range(int(input())):
	n = int(input())
	if n % 3 == 0:
		print(n // 3, n // 3)
	else:
		k = n // 3
		if k + 1 + 2 * k == n:
			print(k + 1, k)
		else:
			print(k, k + 1)


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inara():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
for _ in range(inp()):
	n = inp()
	one = n // 3
	two = n // 3
	if n % 3 == 1:
		one += 1
	elif n % 3 == 2:
		two += 1
	print(one, two)


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	c1 = n // 3
	c2 = n // 3
	if n % 3 == 1:
		c1 += 1
	elif n % 3 == 2:
		c2 += 1
	print('%d %d' % (c1, c2))


import math
t = int(input())
while t:
	n = int(input())
	ans = n // 3
	ans1 = math.ceil((n - ans) / 2)
	if ans + ans1 * 2 == n:
		print(ans, ans1)
	else:
		print(ans1, ans)
	t = t - 1


d = int(input())
for i in range(d):
	n = int(input())
	quyu = n % 3
	num = int(n / 3)
	a = 0
	b = 0
	if quyu == 1:
		a = num + 1
		b = num
		print(a, b)
	elif quyu == 0:
		a = b = num
		print(a, b)
	elif quyu == 2:
		a = num
		b = num + 1
		print(a, b)


n = int(input())
for i in range(n):
	x = int(input())
	a = x // 3
	b = x // 3
	c = x // 3
	if x % 3 == 1:
		print(a + 1, b)
	if x % 3 == 2:
		print(a, b + 1)
	if x % 3 == 0:
		print(a, b)


for _ in range(int(input())):
	n = int(input())
	n12 = n // 3
	n1 = n // 3
	n2 = n // 3
	n = n % 3
	if n == 2:
		n2 += 1
	if n == 1:
		n1 += 1
	print(n1, n2)


t = int(input())
from math import floor, ceil
for _ in range(t):
	n = int(input())
	third = n / 3
	if third - floor(third) > 0.5:
		print(floor(third), ceil(third))
	else:
		print(ceil(third), floor(third))


t = int(input())
A = []
B = []

def Input(a):
	b = a // 3
	if a % 3 == 2:
		A.append(b)
		B.append(b + 1)
	elif a % 3 == 1:
		A.append(b + 1)
		B.append(b)
	else:
		A.append(b)
		B.append(b)
for i in range(t):
	a = int(input())
	Input(a)
for i in range(t):
	print(A[i], B[i])


for i in range(int(input())):
	n = int(input())
	get = n // 3
	if n % 3 == 0:
		print(get, get)
	if n % 3 == 1:
		print(get + 1, get)
	if n % 3 == 2:
		print(get, get + 1)


for iii in range(int(input())):
	n = int(input())
	if n % 3 == 0:
		print(n // 3, n // 3)
	elif (n - 1) % 3 == 0:
		print(n // 3 + 1, n // 3)
	else:
		print(n // 3, n // 3 + 1)


ans = []
for _ in range(int(input())):
	n = int(input())
	d = n // 3
	r = n % 3
	if r == 0:
		ans += ['%d %d' % (d, d)]
	elif r == 1:
		ans += ['%d %d' % (d + 1, d)]
	else:
		ans += ['%d %d' % (d, d + 1)]
print('\n'.join(ans))


xx = int(input())
for zz in range(xx):
	n = int(input())
	if n % 3 == 0 or n % 3 == 1:
		x = n // 3
		print(n - 2 * x, x)
	elif n % 3 == 2:
		x = n // 3 + 1
		print(n - 2 * x, x)


def check(x):
	r = x % 3
	a = x // 3
	if r == 0:
		return [a, a]
	elif r == 1:
		return [a + 1, a]
	else:
		return [a, a + 1]
listf = []
t = int(input())
for x in range(t):
	n = int(input())
	m = ''
	a = check(n)
	for y in a:
		m += str(y) + ' '
	listf.append(m)
for g in listf:
	print(g)


t = int(input())
for k in range(t):
	n = int(input())
	if n % 3 == 0:
		c2 = n // 3
		print(n - 2 * c2, c2)
	else:
		c2 = n // 3
		x = c2 + 1
		if abs(n - 3 * c2) < abs(n - 3 * x):
			print(n - 2 * c2, c2)
		else:
			print(n - 2 * x, x)


def solve(n):
	q = n // 3
	r = n % 3
	if r == 0:
		return (q, q)
	elif r == 1:
		return (q + 1, q)
	else:
		return (q, q + 1)

def main():
	p = int(input())
	for i in range(p):
		l = int(input())
		(a, b) = solve(l)
		print(f'{a} {b}')
main()


def polycarp():
	k = int(input())
	for _ in range(k):
		n = int(input())
		c1 = n // 3
		c2 = n // 3
		if n % 3 == 1:
			c1 += 1
		if n % 3 == 2:
			c2 += 1
		print(c1, c2)
polycarp()


import math
x = int(input())
for t in range(x):
	n = int(input())
	a = math.ceil(n / 3)
	b = math.floor(n / 3)
	if a + 2 * b != n:
		print(b, a)
	elif a + 2 * b == n:
		print(a, b)


ans = []
for _ in range(int(input())):
	n = int(input())
	t = n // 3
	if t * 3 == n:
		ans.append((t, t))
	elif t + 2 * (t + 1) == n:
		ans.append((t, t + 1))
	else:
		ans.append((t + 1, t))
for i in ans:
	print(*i)


from math import ceil
for s in [*open(0)][1:]:
	n = int(s)
	n2 = (n + 1) // 3
	print(n - n2 * 2, n2)


def calc(num):
	if int(num) + 0.5 <= num:
		return int(num) + 1
	else:
		return int(num)
t = int(input())
for _ in range(t):
	n = int(input())
	c2 = calc(n / 3)
	c1 = n - 2 * c2
	print(c1, c2)


T = int(input())
for i in range(T):
	n = int(input())
	c = n // 3
	if n % 3 == 0:
		print(c, c)
		continue
	elif c * 2 + (c + 1) * 1 == n:
		print(c + 1, c)
	else:
		print(c, c + 1)


N = int(input())
for i in range(N):
	f = int(input())
	c = f // 3
	print(c + int(f % 3 == 1), c + int(f % 3 == 2))


def string():
	return list(map(int, input().split(' ')))

def inp():
	return int(input())

def s():
	return input()
import math
for _ in range(inp()):
	n = inp()
	value = n // 3
	if (n - value) % 2 == 0:
		print(value, (n - value) // 2)
	else:
		print((n - value) // 2 + 1, value)


from math import *
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 3 == 0:
		print(str(int(n / 3)) + ' ' + str(int(n / 3)))
	elif n % 3 == 1:
		print(str(int(n / 3) + 1) + ' ' + str(int(n / 3)))
	else:
		print(str(int(n / 3)) + ' ' + str(int(n / 3) + 1))


def solve():
	n = int(input())
	if n % 3 == 0:
		print(n // 3, n // 3)
	elif n % 3 == 1:
		print(n // 3 + 1, n // 3)
	else:
		print(n // 3, n // 3 + 1)

def main():
	for _ in range(int(input())):
		solve()
main()


t = int(input())
while t != 0:
	n = int(input())
	a = n // 3
	if n % 3 == 0:
		print(a, a)
	elif (n - 2) % 3 == 0:
		print((n - 2) // 3, (n + 1) // 3)
	elif (n - 1) % 3 == 0:
		print((n + 2) // 3, (n - 1) // 3)
	else:
		pass
	t -= 1


def func(a):
	ta = a // 3
	if a % 3 == 0:
		return (ta, ta)
	elif a % 3 == 1:
		return (ta + 1, ta)
	elif a % 3 == 2:
		return (ta, ta + 1)
t = int(input())
for i in range(t):
	a = int(input())
	(c1, c2) = func(a)
	print(c1, c2)


t = int(input())
for i in range(t):
	k = int(input())
	(c1, c2) = (k // 3, k // 3)
	if c1 + 2 * c2 == k:
		print(str(c1) + ' ' + str(c2))
	elif c1 + 2 * c2 == k - 1:
		print(str(c1 + 1) + ' ' + str(c2))
	elif c1 + 2 * c2 == k - 2:
		print(str(c1) + ' ' + str(c2 + 1))
	elif c1 + 2 * c2 == k + 1:
		print(str(c1 - 1) + ' ' + str(c2))
	elif c1 + 2 * c2 == k + 2:
		print(str(c1) + ' ' + str(c2 - 1))


import sys
import math
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	c1 = n // 3
	c2 = math.ceil((n - c1) / 2)
	if c1 * 2 + c2 == n:
		print(c2, c1)
	else:
		print(c1, c2)


mas = list(map(int, input().split()))
t = mas[0]
for j in range(t):
	mas = list(map(int, input().split()))
	n = mas[0]
	l = n // 3
	k = n % 3
	if k == 1:
		print(l + 1, l)
	elif k == 2:
		print(l, l + 1)
	else:
		print(l, l)


t = int(input())
while t > 0:
	n = int(input())
	val1 = n // 3
	val2 = val1 * 2
	if val1 + val2 == n:
		print(val1, val2 // 2)
	elif val1 + val2 == n - 1:
		print(val1 + 1, val2 // 2)
	else:
		print(val1, val2 // 2 + 1)
	t -= 1


import math
import sys
inp = int(input())
for _ in range(inp):
	n = int(input())
	(x, y) = divmod(n, 3)
	if y == 0:
		print(str(x) + ' ' + str(x))
	elif y == 1:
		print(str(x + 1) + ' ' + str(x))
	else:
		print(str(x) + ' ' + str(x + 1))


from sys import stdin
input = stdin.readline
rn = lambda : int(input())
rns = lambda : map(int, input().split())
rl = lambda : list(map(int, input().split()))
rs = lambda : input().strip()
YN = lambda x: print('YES') if x else print('NO')
mod = 10 ** 9 + 7
for _ in range(rn()):
	n = rn()
	if n % 3 == 0:
		print(n // 3, n // 3)
	elif n % 3 == 1:
		print(n // 3 + 1, n // 3)
	else:
		print(n // 3, n // 3 + 1)


for _ in range(int(input())):
	a = int(input())
	twos = round(a / 3)
	ones = a - twos * 2
	print(ones, twos)


n = int(input())
t = 1
while t <= n:
	a = 0
	b = 0
	val = int(input())
	a = int(val / 3)
	b = int(val / 3)
	if val % 3 == 1:
		a += 1
	elif val % 3 == 2:
		b += 1
	print(f'{a} {b}')
	t += 1


from sys import stdin

def A():
	t = int(stdin.readline())
	while t:
		t -= 1
		n = int(stdin.readline())
		if n % 3 == 0:
			print(n // 3, end=' ')
			print(n // 3)
			continue
		sav = n // 3
		while (n - sav) % 2 != 0:
			sav += 1
		print(sav, end=' ')
		print((n - sav) // 2)
A()


result = ''
for i in range(0, int(input())):
	n = int(input())
	temp = n
	for k in range(0, 4):
		if temp % 3 == 0:
			break
		else:
			temp -= 1
	if n - temp == 0:
		result += str(n // 3) + ' ' + str(n // 3) + '\n'
	elif n - temp == 1:
		result += str(n // 3 + 1) + ' ' + str(n // 3) + '\n'
	else:
		result += str(n // 3) + ' ' + str(n // 3 + 1) + '\n'
print(result)


t = int(input())
for i in range(t):
	n = int(input())
	count = int(1 / 3 * n)
	if count * 1 + count * 2 == n:
		print('{} {}'.format(count, count))
	elif (count + 1) * 1 + count * 2 == n:
		print('{} {}'.format(count + 1, count))
	else:
		print('{} {}'.format(count, count + 1))


import collections
import math

def function():
	n = int(input())
	res = []
	for _ in range(n):
		p = int(input())
		if p == 1:
			res.append((1, 0))
			continue
		two = round(2 / 3 * p)
		one = p - two
		res.append((two - one, one))
	return res
for e in function():
	print(' '.join((str(p) for p in e)))


for i in range(int(input())):
	amt = int(input())
	c2 = amt // 3
	min1 = abs(amt - 2 * c2 - c2)
	min2 = abs(c2 + 1 - (amt - 2 * (c2 + 1)))
	if abs(min1) < abs(min2):
		print(amt - 2 * c2, c2)
	else:
		print(amt - 2 * (c2 + 1), c2 + 1)


def solve():
	n = int(input())
	uno = dos = int(n / 3)
	if n % 3 == 1:
		uno += 1
	if n % 3 == 2:
		dos += 1
	print(uno, dos)

def init():
	T = 1
	T = int(input())
	while T:
		solve()
		T -= 1
init()


def polycarp(N):
	n = N // 3
	r = N % 3
	if r <= 1:
		return [n + r, n]
	else:
		return [n, n + 1]
N = int(input())
for _ in range(N):
	print(*polycarp(int(input())))


def solve(n):
	ans = n // 3
	mod = n % 3
	first = ans
	second = ans
	if mod == 1:
		first += 1
	elif mod == 2:
		second += 1
	return [first, second]
for _ in range(int(input())):
	n = int(input())
	print(*solve(n))


for _ in range(int(input())):
	n = int(input())
	a = n // 3
	d = n % 3
	if d == 2:
		print(a, end=' ')
		print(a + 1)
	elif d == 0:
		print(a, end=' ')
		print(a)
	elif d == 1:
		print(a + 1, end=' ')
		print(a)


import sys
input = sys.stdin.readline

def I():
	return input().strip()

def II():
	return int(input().strip())

def LI():
	return [*map(int, input().strip().split())]
import copy, string, math, time, functools, random, fractions
from heapq import heappush, heappop, heapify
from bisect import bisect_left, bisect_right
from collections import deque, defaultdict, Counter, OrderedDict
from itertools import permutations, combinations, groupby
from operator import itemgetter
for _ in range(II()):
	n = II()
	if n % 3 == 0:
		print(n // 3, n // 3)
	elif 2 * (n // 3 + 1) + n // 3 == n:
		print(n // 3, n // 3 + 1)
	else:
		print(n // 3 + 1, n // 3)


t = int(input())
ans = []
for i in range(0, t):
	n = int(input())
	temp = round(n / 3)
	s = f'{n - temp * 2} {temp}'
	ans.append(s)
for i in ans:
	print(i)


import math
for t in range(int(input())):
	n = int(input())
	(c1, c2) = (0, 0)
	if n % 3 == 0:
		(c1, c2) = (n // 3, n // 3)
	elif n % 3 == 1:
		(c1, c2) = (n // 3 + 1, n // 3)
	else:
		(c1, c2) = (n // 3, n // 3 + 1)
	print(c1, c2)


t = int(input())
for _ in range(t):
	n = int(input())
	if n % 3 == 0:
		c1 = n // 3
		c2 = c1
	if n % 3 == 1:
		c2 = (n - 1) // 3
		c1 = c2 + 1
	if n % 3 == 2:
		c2 = (n + 1) // 3
		c1 = c2 - 1
	print('{} {}'.format(c1, c2))


import math
S = [0] * 200000
t = int(input())
for i in range(t):
	n = int(input())
	mod = n // 3
	if n % 3 == 0:
		mod = mod - 1
	if n % 3 == 1:
		print(str(mod + 1) + ' ' + str(mod))
	if n % 3 == 2:
		print(str(mod) + ' ' + str(mod + 1))
	if n % 3 == 0:
		print(str(mod + 1) + ' ' + str(mod + 1))


t = int(input())
for i in range(t):
	n = int(input())
	c = n // 3
	if (n - n // 3) % 2 == 0:
		print(n // 3, (n - n // 3) // 2)
	else:
		print(n // 3 + 1, (n - n // 3) // 2)


import sys
from bisect import bisect
from math import sqrt, ceil, floor

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def rinput():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))
mod = int(1000000000.0) + 7
for _ in range(iinput()):
	n = iinput()
	c1 = n // 3
	c2 = (n - c1) / 2
	if c2 == int(c2):
		print(int(c1), int(c2))
		continue
	c4 = n // 3
	c3 = n - 2 * c4
	print(int(c3), int(c4))


t = int(input())
for i in range(t):
	n = int(input())
	x = n // 3
	if (n - x) % 2 == 0:
		print(x, (n - x) // 2)
	else:
		print(n - 2 * x, x)


def solve():
	n = int(input())
	base = n // 3
	if n - base * 3 == 1:
		print(str(base + 1) + ' ' + str(base))
	elif n - base * 3 == 2:
		print(str(base) + ' ' + str(base + 1))
	else:
		print(str(base) + ' ' + str(base))

def main():
	t = int(input())
	for i in range(t):
		solve()
main()


def main():
	for i in range(int(input())):
		a = int(input())
		x = a // 3
		if not (a - x) % 2:
			if abs(a - 2 * x - x) > abs(x - (a - x) // 2):
				print(f'{x} {(a - x) // 2}')
			else:
				print(f'{a - 2 * x} {x}')
		else:
			print(f'{a - 2 * x} {x}')
main()


import os.path
from math import gcd, floor, ceil
from collections import *
import sys
mod = 1000000007
INF = float('inf')

def st():
	return list(sys.stdin.readline().strip())

def li():
	return list(map(int, sys.stdin.readline().split()))

def mp():
	return map(int, sys.stdin.readline().split())

def inp():
	return int(sys.stdin.readline())

def pr(n):
	return sys.stdout.write(str(n) + '\n')

def prl(n):
	return sys.stdout.write(str(n) + ' ')
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def solve():
	n = inp()
	if n % 3 == 0:
		print(n // 3, n // 3)
		return
	if (n - 2) % 3 == 0:
		print((n - 2) // 3, (n - 2) // 3 + 1)
		return
	print((n - 1) // 3 + 1, (n - 1) // 3)
for _ in range(inp()):
	solve()


from math import *
from itertools import *

def solve():
	n = int(input())
	third = n // 3
	ans1 = third
	ans2 = ceil((n - ans1) / 2)
	if n % 3 == 0:
		print(n // 3, n // 3)
	elif n % 3 == 1:
		print(n // 3 + 1, n // 3)
	else:
		print(n // 3, n // 3 + 1)

def dkjfjfk():
	for i in range(int(input())):
		solve()
dkjfjfk()


def main():
	for i in range(num()):
		solve()

def solve():
	n = num()
	if n % 3 == 0:
		print(int(n / 3), int(n / 3))
	elif n % 3 == 2:
		print(int((n - 2) / 3), int((n - 2) / 3) + 1)
	else:
		print(int((n - 1) / 3) + 1, int((n - 1) / 3))
import itertools
import bisect, math
import copy
import fractions

def s(e):
	return sum(e)

def l(e):
	return len(e)

def num():
	return int(input())

def array():
	return list(map(int, input().split()))

def pair():
	return map(int, input().split())

def p(x='', end='\n'):
	return print(x, end=end)

def sort(a):
	return sorted(a)

def fpair(x):
	return str(fractions.Fraction(x)).split('/')

def parray(a):
	for i in a:
		p(i, end=' ')
	p()
main()