Polycarp had an array $a$ of $3$ positive integers. He wrote out the sums of all non-empty subsequences of this array, sorted them in non-decreasing order, and got an array $b$ of $7$ integers.

For example, if $a = \{1, 4, 3\}$, then Polycarp wrote out $1$, $4$, $3$, $1 + 4 = 5$, $1 + 3 = 4$, $4 + 3 = 7$, $1 + 4 + 3 = 8$. After sorting, he got an array $b = \{1, 3, 4, 4, 5, 7, 8\}.$

Unfortunately, Polycarp lost the array $a$. He only has the array $b$ left. Help him to restore the array $a$.


-----Input-----

The first line contains one integer $t$ ($1 \le t \le 5000$) — the number of test cases.

Each test case consists of one line which contains $7$ integers $b_1, b_2, \dots, b_7$ ($1 \le b_i \le 10^9$; $b_i \le b_{i+1}$).

Additional constraint on the input: there exists at least one array $a$ which yields this array $b$ as described in the statement.


-----Output-----

For each test case, print $3$ integers — $a_1$, $a_2$ and $a_3$. If there can be several answers, print any of them.


-----Examples-----

Input
5
1 3 4 4 5 7 8
1 2 3 4 5 6 7
300000000 300000000 300000000 600000000 600000000 600000000 900000000
1 1 2 999999998 999999999 999999999 1000000000
1 2 2 3 3 4 5
Output
1 4 3
4 1 2
300000000 300000000 300000000
999999998 1 1
1 2 2


-----Note-----

The subsequence of the array $a$ is a sequence that can be obtained from $a$ by removing zero or more of its elements.

Two subsequences are considered different if index sets of elements included in them are different. That is, the values of the elements don't matter in the comparison of subsequences. In particular, any array of length $3$ has exactly $7$ different non-empty subsequences.

Difficulty: EASY
Tags: Sorting

Mathematics
Skill types: Sorting

Starter code:

Solutions:
from collections import defaultdict
from os import path, truncate
from sys import int_info, stdin, stdout

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

def gms():
	return map(str, stdin.readline().strip().split())

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

def gart():
	return tuple(map(int, stdin.readline().strip().split()))

def gars():
	return list(map(str, stdin.readline().strip().split()))

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

def gls():
	return list(stdin.readline().strip())

def gi():
	return int(stdin.readline())
for _ in range(gi()):
	l = list(map(int, input().split()))
	print(l[0], l[4] - l[0], l[5] - l[4] + l[0])


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')
from itertools import permutations
from collections import *
from collections import deque
from operator import itemgetter, attrgetter
from decimal import *
import bisect
import math
import heapq as hq
MOD = 10 ** 9 + 7

def is_prime(n):
	if n == 2 or n == 3:
		return True
	if n < 2 or n % 2 == 0:
		return False
	if n < 9:
		return True
	if n % 3 == 0:
		return False
	r = int(n ** 0.5)
	f = 5
	while f <= r:
		if n % f == 0:
			return False
		if n % (f + 2) == 0:
			return False
		f += 6
	return True

def pow(a, b, m):
	ans = 1
	while b:
		if b & 1:
			ans = ans * a % m
		b //= 2
		a = a * a % m
	return ans

def ispalindrome(s):
	if s[:] == s[::-1]:
		return 1
	return 0
dp = []
limit = []
v = []

def dpdfs(u, t=-1):
	dp[0][u] = 0
	dp[1][u] = 0
	for i in v[u]:
		if i == t:
			continue
		if dp[1][i] == -1:
			dpdfs(i, u)
		dp[0][u] += max(abs(limit[0][u] - limit[1][i]) + dp[1][i], abs(limit[0][u] - limit[0][i]) + dp[0][i])
		dp[1][u] += max(abs(limit[1][u] - limit[1][i]) + dp[1][i], abs(limit[1][u] - limit[0][i]) + dp[0][i])
vis = []
f = 0
from math import factorial as fact
from queue import PriorityQueue

def z_algorithm(s):
	res = [0] * len(s)
	res[0] = len(s)
	(i, j) = (1, 0)
	while i < len(s):
		while i + j < len(s) and s[j] == s[i + j]:
			j += 1
		res[i] = j
		if j == 0:
			i += 1
			continue
		k = 1
		while i + k < len(s) and k + res[k] < j:
			res[i + k] = res[k]
			k += 1
		(i, j) = (i + k, j - k)
	return res

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

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

def gcdExtended(a, b):
	if a == 0:
		return (b, 0, 1)
	(gcd, x1, y1) = gcdExtended(b % a, a)
	x = y1 - b // a * x1
	y = x1
	return (gcd, x, y)
import re
for _ in range(int(input())):
	l = list(map(int, input().split()))
	for i in range(2):
		print(l[i], end=' ')
	print(l[6] - l[0] - l[1])


for _ in range(int(input())):
	res = []
	workwith = list(map(int, input().split()))
	if workwith[2] == workwith[0] + workwith[1]:
		res.append(workwith[0])
		res.append(workwith[1])
		res.append(workwith[3])
	else:
		res.append(workwith[0])
		res.append(workwith[1])
		res.append(workwith[2])
	print(*res)


from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	a = list(map(int, stdin.readline().split()))
	a.sort()
	ans = [a[0], a[1]]
	if a[2] == a[0] + a[1]:
		ans.append(a[3])
	else:
		ans.append(a[2])
	print(ans[0], ans[1], ans[2])


t = int(input())
for i in range(t):
	a = list(map(int, input().split()))
	if a[0] + a[1] + a[2] == a[6]:
		print(a[0], a[1], a[2])
	elif a[0] + a[1] + a[3] == a[6]:
		print(a[0], a[1], a[3])


for _ in range(int(input())):
	(a, b, c, d, e, ff, g) = map(int, input().split())
	ans = e
	if a + b != c:
		ans = c
	elif a + b != d:
		ans = d
	print(a, b, g - a - b)


for _ in range(int(input())):
	b = list(map(int, input().split()))
	p = len(b)
	s = max(b)
	a1 = 0
	a2 = 0
	a3 = 0
	for i in range(p - 2):
		for j in range(i + 1, p - 1):
			for k in range(j + 1, p):
				if b[i] + b[j] + b[k] == s:
					a1 = b[i]
					a2 = b[j]
					a3 = b[k]
	print(str(a1) + ' ' + str(a2) + ' ' + str(a3))


T = int(input())
for i in range(T):
	arr = [int(x) for x in input().split()]
	a1 = arr[0]
	a2 = arr[1]
	s = a1 + a2
	idx = 2
	if arr[idx] == s:
		idx += 1
	print(a1, a2, arr[idx])


for _ in range(int(input())):
	l = list(map(int, input().split()))
	su = l[6]
	a = l[6] - l[5]
	b = l[6] - a - l[1]
	c = su - a - b
	print(a, b, c)


t = int(input())
for _ in range(t):
	k = list(map(int, input().split()))
	print(k[0], k[1], k[-1] - k[0] - k[1])


n = int(input())
for i in range(n):
	a = list(map(int, input().split()))
	print(a[0], a[1], a[-1] - a[0] - a[1])


t = int(input())
for _ in range(t):
	a = list(map(int, input().split()))
	r = []
	r.append(a[-1] - a[-2])
	r.append(a[-1] - a[-3])
	x = a[-1] - a[-4]
	if sum(r) + x == a[-1]:
		r.append(x)
	else:
		r.append(a[-1] - a[-5])
	print(*r)


t = int(input())
data = []
for i in range(t):
	s = input()
	a = s.split(' ')
	data.append(a)
for i in data:
	print(int(i[0]), int(i[1]), int(i[-1]) - int(i[0]) - int(i[1]))


class Solution:

	def find(self, arr):
		maxx = arr[-1]
		for i in range(len(arr) - 1):
			for j in range(i + 1, len(arr) - 1, 1):
				for k in range(j + 1, len(arr) - 1, 1):
					if arr[i] + arr[j] + arr[k] == maxx:
						print(arr[i], arr[j], arr[k])
						return
t = int(input())
obj = Solution()
for _ in range(t):
	obj.find(list(map(int, input().split())))


for _ in range(int(input())):
	total = 0
	nums = input().split()
	sum = int(nums[-1])
	total += int(nums[0])
	for i in range(1, 3):
		for j in range(i + 1, 4):
			temp = int(nums[i]) + int(nums[j])
			if int(temp) + int(total) == sum:
				print(int(nums[i]), int(nums[j]), int(total))
				break


n = int(input())
for i in range(n):
	ls = list(map(int, input().split()))
	final = [ls[0], ls[1]]
	if ls[0] + ls[1] > ls[2]:
		final.append(ls[2])
	else:
		final.append(ls[3])
	print(*final)


t = int(input())
for i in range(t):
	lis = [int(i) for i in input().split()]
	a = [lis[0]]
	n = len(lis)
	sumOfBandC = lis[n - 1] - lis[0]
	l = 1
	r = n - 2
	while l < r:
		if lis[r] >= sumOfBandC:
			r = r - 1
		if lis[r] < sumOfBandC:
			if lis[l] + lis[r] == sumOfBandC:
				a.append(lis[l])
				a.append(lis[r])
				break
			else:
				if lis[l] + lis[r] > sumOfBandC:
					r = r - 1
				if lis[l] + lis[r] < sumOfBandC:
					l = l + 1
	print(*a)


for _ in range(int(input())):
	lst = [int(i) for i in input().split()]
	if lst[2] == lst[0] + lst[1]:
		print(lst[0], lst[1], lst[3])
	else:
		print(lst[0], lst[1], lst[2])


t = int(input())
while t:
	arr = list(map(int, input().split(' ')))
	(a, b) = (arr[0], arr[1])
	pointer = 2
	if arr[pointer] == a + b:
		pointer += 1
	print(a, b, arr[pointer])
	t -= 1


a = int(input())
ms = []
for i in range(a):
	ms.append(list(map(int, input().split())))
for i in range(a):
	b = []
	b.append(ms[i].pop(0))
	s2 = ms[i].pop() - b[0]
	if ms[i][0] + ms[i][1] == s2:
		b.append(ms[i][0])
		b.append(ms[i][1])
	else:
		b.append(ms[i][0])
		b.append(ms[i][2])
	print(b[0], b[1], b[2])


import sys
from bisect import bisect_left as lb
from bisect import bisect_right as rb
from collections import deque
from queue import PriorityQueue as pq
from math import gcd
input_ = lambda : sys.stdin.readline().strip('\r\n')
ii = lambda : int(input_())
il = lambda : list(map(int, input_().split()))
ilf = lambda : list(map(float, input_().split()))
lii = lambda : list(map(int, list(ip())))
ip = lambda : input_()
fi = lambda : float(input_())
ap = lambda ab, bc, cd: ab[bc].append(cd)
li = lambda : list(input_())
pr = lambda x: print(x)
prinT = lambda x: print(x)
f = lambda : sys.stdout.flush()
inv = lambda x: pow(x, mod - 2, mod)
dx = [0, 0, 1, -1]
dy = [1, -1, 0, 0]
mod = 10 ** 9 + 7
mod1 = 998244353
for _ in range(ii()):
	a = il()
	x = a[0]
	y = a[1]
	t = x + y
	z = a[-1] - x - y
	print(x, y, z)


for _ in range(int(input())):
	a = list(map(int, input().split()))
	b = []
	b.append(a[0])
	b.append(a[1])
	for i in range(len(a) - 1):
		if a[0] + a[1] != a[2]:
			b.append(a[2])
			break
		else:
			b.append(a[3])
			break
	print(*b)


import math
import os
import sys
from sys import *
from decimal import *
from io import BytesIO, IOBase
import threading
from itertools import *
from collections import *
from array import *
import random
M = 10 ** 9 + 7
import heapq
import bisect
from functools import lru_cache
from queue import PriorityQueue
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 sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

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

def strsep():
	return map(str, inp().split())

def fsep():
	return map(float, inp().split())

def inpu():
	return int(inp())

def regularbracket(t):
	p = 0
	for i in t:
		if i == '(':
			p += 1
		else:
			p -= 1
		if p < 0:
			return False
	else:
		if p > 0:
			return False
		else:
			return True

def binarySearchcount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = (right + left) // 2
		if arr[mid] <= key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def binarySearch(arr, n, key):
	left = 0
	right = n - 1
	while left <= right:
		mid = (right + left) // 2
		if arr[mid] == key:
			return mid
		if arr[mid] <= key:
			left = mid + 1
		else:
			right = mid - 1
	return -1

def ternarysearch(arr, n, key):
	(l, r) = (0, n - 1)
	while l <= r:
		mid = (-l + r) // 3 + l
		mid2 = mid + (-l + r) // 3
		if arr[mid] == key:
			return mid
		if arr[mid2] == key:
			return mid2
		if arr[mid] > key:
			r = mid - 1
		elif arr[mid2] < key:
			l = mid2 + 1
		else:
			l = mid + 1
			r = mid2 - 1
	return -1

def reverse1(string):
	pp = ''
	for i in string[::-1]:
		pp += i
	if pp == string:
		return True
	return False

def reverse2(list1):
	l = []
	for i in list1[::-1]:
		l.append(i)
	if l == list1:
		return True
	return False

def sumofdigits(n):
	n = str(n)
	s1 = 0
	for i in n:
		s1 += int(i)
	return s1

def perfect_square(n):
	s = math.sqrt(n)
	if s == int(s):
		return True
	return False

def roman_number(x):
	if x > 15999:
		return
	value = [5000, 4000, 1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1]
	symbol = ['F', 'MF', 'M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I']
	roman = ''
	i = 0
	while x > 0:
		div = x // value[i]
		x = x % value[i]
		while div:
			roman += symbol[i]
			div -= 1
		i += 1
	return roman

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

def countRhombi(h, w):
	ct = 0
	for i in range(2, h + 1, 2):
		for j in range(2, w + 1, 2):
			ct += (h - i + 1) * (w - j + 1)
	return ct

def countrhombi2(h, w):
	return h * h // 4 * (w * w // 4)

def binpow(a, b):
	if b == 0:
		return 1
	else:
		res = binpow(a, b // 2)
	if b % 2 != 0:
		return res * res * a
	else:
		return res * res

def coprime_to_n(n):
	result = n
	i = 2
	while i * i <= n:
		if n % i == 0:
			while n % i == 0:
				n //= i
			result -= result // i
		i += 1
	if n > 1:
		result -= result // n
	return result

def luckynumwithequalnumberoffourandseven(x, n, a):
	if x >= n and str(x).count('4') == str(x).count('7'):
		a.append(x)
	elif x < 1000000000000.0:
		luckynumwithequalnumberoffourandseven(x * 10 + 4, n, a)
		luckynumwithequalnumberoffourandseven(x * 10 + 7, n, a)
	return a

def luckynum(x, l, r, a):
	if x >= l and x <= r:
		a.append(x)
	if x > r:
		a.append(x)
		return a
	if x < 10000000000.0:
		luckynum(x * 10 + 4, l, r, a)
		luckynum(x * 10 + 7, l, r, a)
	return a

def luckynuber(x, n, a):
	p = set(str(x))
	if len(p) <= 2:
		a.append(x)
	if x < n:
		luckynuber(x + 1, n, a)
	return a

def interact(type, x):
	if type == 'r':
		inp = input()
		return inp.strip()
	else:
		print(x, flush=True)

def findTrailingZeros(n):
	count = 0
	while n >= 5:
		n //= 5
		count += n
	return count

def mergeSort(arr):
	if len(arr) > 1:
		mid = len(arr) // 2
		L = arr[:mid]
		R = arr[mid:]
		mergeSort(L)
		mergeSort(R)
		i = j = k = 0
		while i < len(L) and j < len(R):
			if L[i] < R[j]:
				arr[k] = L[i]
				i += 1
			else:
				arr[k] = R[j]
				j += 1
			k += 1
		while i < len(L):
			arr[k] = L[i]
			i += 1
			k += 1
		while j < len(R):
			arr[k] = R[j]
			j += 1
			k += 1

def solven(p, l, a, b, n, res):
	if p > n or l > 10:
		return
	if p > 0:
		res.add(p)
	solven(p * 10 + a, l + 1, a, b, n)
	solven(p * 10 + b, l + 1, a, b, n)

def subsetsUtil(A, subset, index, d):
	print(*subset)
	s = sum(subset)
	d.append(s)
	for i in range(index, len(A)):
		subset.append(A[i])
		subsetsUtil(A, subset, i + 1, d)
		subset.pop(-1)
	return d

def subsetSums(arr, l, r, d, sum=0):
	if l > r:
		d.append(sum)
		return
	subsetSums(arr, l + 1, r, d, sum + arr[l])
	subsetSums(arr, l + 1, r, d, sum)
	return d

def print_factors(x):
	factors = []
	for i in range(1, x + 1):
		if x % i == 0:
			factors.append(i)
	return factors

def calc(X, d, ans, D):
	if len(X) == 0:
		return
	i = X.index(max(X))
	ans[D[max(X)]] = d
	Y = X[:i]
	Z = X[i + 1:]
	calc(Y, d + 1, ans, D)
	calc(Z, d + 1, ans, D)

def generate(st, s):
	if len(s) == 0:
		return
	if s not in st:
		st.add(s)
		for i in range(len(s)):
			t = list(s).copy()
			t.remove(s[i])
			t = ''.join(t)
			generate(st, t)
	return

def largestincreasingsubsequence(A):
	l = [1] * len(A)
	for i in range(1, len(l)):
		for k in range(i):
			if A[k] <= A[i]:
				l[i] = max(l[i], l[k] + 1)
	return max(l)

def findOR(nums, N):
	prefix_sum = 0
	result = 0
	for i in range(N):
		result |= nums[i]
		prefix_sum += nums[i]
		result |= prefix_sum
	return result

def OR(a, n):
	ans = a[0]
	for i in range(1, n):
		ans |= a[i]
	return ans

def toString(List):
	return ''.join(List)

def permute(a, l, r, p):
	if l == r:
		p.append(toString(a))
	else:
		for i in range(l, r + 1):
			(a[l], a[i]) = (a[i], a[l])
			permute(a, l + 1, r, p)
			(a[l], a[i]) = (a[i], a[l])

def squareRoot(number, precision):
	start = 0
	(end, ans) = (number, 1)
	while start <= end:
		mid = int((start + end) / 2)
		if mid * mid == number:
			ans = mid
			break
		if mid * mid < number:
			start = mid + 1
		else:
			end = mid - 1
	increment = 0.1
	for i in range(0, precision):
		while ans * ans <= number:
			ans += increment
		ans = ans - increment
		increment = increment / 10
	return ans

def countRectangles(l, w):
	squareSide = math.gcd(l, w)
	return int(l * w / (squareSide * squareSide))

def count_same_digit(L, R):
	tmp = 0
	ans = 0
	n = int(math.log10(R) + 1)
	for i in range(0, n):
		tmp = tmp * 10 + 1
		for j in range(1, 10):
			if L <= tmp * j and tmp * j <= R:
				ans += 1
	return ans

def findCrossOver(arr, low, high, x):
	if arr[high] <= x:
		return high
	if arr[low] > x:
		return low
	mid = (low + high) // 2
	if arr[mid] <= x and arr[mid + 1] > x:
		return mid
	if arr[mid] < x:
		return findCrossOver(arr, mid + 1, high, x)
	return findCrossOver(arr, low, mid - 1, x)

def Kclosest(arr, x, k, n, ans):
	l = findCrossOver(arr, 0, n - 1, x)
	r = l + 1
	count = 0
	if arr[l] == x:
		l -= 1
	while l >= 0 and r < n and (count < k):
		if x - arr[l] < arr[r] - x:
			ans.append(arr[l])
			l -= 1
		else:
			ans.append(arr[r])
			r += 1
		count += 1
	while count < k and l >= 0:
		ans.append(arr[l])
		l -= 1
		count += 1
	while count < k and r < n:
		ans.append(arr[r])
		r += 1
		count += 1
	return ans

def dfs(root, nodeVal, nodeConnection, visited):
	leftVal = nodeVal[root][0]
	rightVal = nodeVal[root][1]
	solution = []
	if nodeConnection[root]:
		visited.add(root)
		for i in nodeConnection[root]:
			if i not in visited:
				solution.append(dfs(i, nodeVal, nodeConnection, visited))
		leftMax = 0
		rightMax = 0
		for i in solution:
			(l, r) = i
			leftMax += max(abs(leftVal - l[0]) + l[1], abs(leftVal - r[0]) + r[1])
			rightMax += max(abs(rightVal - l[0]) + l[1], abs(rightVal - r[0]) + r[1])
		return ((leftVal, leftMax), (rightVal, rightMax))
	else:
		return ((leftVal, 0), (rightVal, 0))

def luckynumber(x, n, a):
	if x > 0:
		a.append(x)
	if x > 10 ** 9:
		return a
	elif x < 1000000000000.0:
		luckynumber(x * 10 + 4, n, a)
		luckynumber(x * 10 + 7, n, a)

def lcm(a, b):
	return a * b // math.gcd(a, b)

def query1(l, r):
	if l >= r:
		return -1
	print('?', l + 1, r + 1)
	sys.stdout.flush()
	return int(input()) - 1

def answer(p):
	print('!', p + 1)
	sys.stdout.flush()
	exit()

def buildPrefix(MAX, prefix):
	prime = [1] * (MAX + 1)
	p = 2
	while p * p <= MAX:
		if prime[p] == 1:
			i = p * 2
			while i <= MAX:
				prime[i] = 0
				i += p
		p += 1
	for p in range(2, MAX + 1):
		prefix[p] = prefix[p - 1]
		if prime[p] == 1:
			prefix[p] += 1

def query(L, R, prefix):
	return prefix[R] - prefix[L - 1]

def maxSubArraySum(a, size):
	max_so_far = a[0]
	curr_max = a[0]
	for i in range(1, size):
		curr_max = max(a[i], curr_max + a[i])
		max_so_far = max(max_so_far, curr_max)
	return max_so_far

def solvepp(n, k):
	if n == 1 and k == 1:
		return 0
	mid = 2 ** (n - 1) // 2
	if k <= mid:
		return solvepp(n - 1, k)
	else:
		return solvepp(n - 1, k - mid) == 0

def solvr(s, p):
	if len(s) == 0:
		print(p, end=' ')
		return
	op1 = p
	op2 = p + s[0]
	s = s[1:]
	solvr(s, op1)
	solvr(s, op2)
	return

def paranthesis(n, m, ans, l):
	if n == 0 and m == 0:
		print(ans)
		return
	if n != 0:
		op1 = ans + '('
		paranthesis(n - 1, m, op1, l)
	if m > n:
		op2 = ans + ')'
		paranthesis(n, m - 1, op2, l)

def rse(arr, n):
	stack = []
	ans = []
	for i in range(n - 1, -1, -1):
		if len(stack) == 0:
			ans.append(n)
		else:
			while len(stack) != 0:
				if stack[-1][0] >= arr[i]:
					stack.pop()
				else:
					break
			if len(stack) == 0:
				ans.append(n)
			else:
				ans.append(stack[-1][1])
		stack.append([arr[i], i])
	ans.reverse()
	return ans

def lse(arr, n):
	stack = []
	ans = []
	for i in range(n):
		if len(stack) == 0:
			ans.append(-1)
		else:
			while len(stack) != 0:
				if stack[-1][0] >= arr[i]:
					stack.pop()
				else:
					break
			if len(stack) == 0:
				ans.append(-1)
			else:
				ans.append(stack[-1][1])
		stack.append([arr[i], i])
	return ans

def mah(arr):
	max1 = 0
	p = rse(arr, len(arr))
	q = lse(arr, len(arr))
	for i in range(len(arr)):
		a = (p[i] - q[i] - 1) * arr[i]
		max1 = max(a, max1)
	return max1

def lcs(s, r):
	rr = len(r)
	ss = len(s)
	l = [[0] * (rr + 1) for i in range(ss + 1)]
	for i in range(1, ss + 1):
		for j in range(1, rr + 1):
			if s[i - 1] == r[j - 1]:
				l[i][j] = l[i - 1][j - 1] + 1
			else:
				l[i][j] = max(l[i - 1][j], l[i][j - 1])
	return l[ss][rr]

def subsetsum(arr, sum, len):
	dp = [[False] * (sum + 1) for i in range(len + 1)]
	for i in range(len + 1):
		dp[i][0] = True
	for i in range(1, len + 1):
		for j in range(1, sum + 1):
			if arr[i - 1] > j:
				dp[i][j] = dp[i - 1][j]
			else:
				dp[i][j] = dp[i - 1][j] or dp[i - 1][j - arr[i - 1]]
	return dp[len][sum]

def matrixmincost(cost, n, m):
	dp = [[0 for x in range(m)] for x in range(n)]
	for i in range(n):
		for j in range(m):
			if i == 0 and j == 0:
				dp[i][j] = cost[i][j]
			elif i == 0 and j != 0:
				dp[i][j] = dp[i][j - 1] + cost[i][j]
			elif j == 0 and i != 0:
				dp[i][j] = dp[i - 1][j] + cost[i][j]
			else:
				dp[i][j] = cost[i][j] + min(dp[i - 1][j], dp[i][j - 1], dp[i - 1][j - 1])
	return dp[n - 1][m - 1]

def coinchange(n, arr, len1):
	dp = [0] * (n + 1)
	dp[0] = 1
	for i in range(len1):
		for j in range(arr[i], n + 1):
			dp[j] += dp[j - arr[i]]
	return dp[n]

class Graph(object):

	def __init__(self, vertices):
		self.graph = defaultdict(list)
		self.V = vertices

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

	def connectedComponents(self):
		unvisited = set(range(self.V))
		queue = deque()
		count = 0
		while len(unvisited) > 0:
			count += 1
			v = next(iter(unvisited))
			unvisited.remove(v)
			queue.append(v)
			while len(queue) > 0:
				v = queue.popleft()
				for w in self.graph[v]:
					if w in unvisited:
						unvisited.remove(w)
						queue.append(w)
		return count

def maxSumIS(arr, n):
	msis = arr.copy()
	for i in range(1, n):
		for j in range(i):
			if arr[i] > arr[j] and msis[i] < msis[j] + arr[i]:
				msis[i] = msis[j] + arr[i]
	c = max(msis)
	p = 5
	return c

def binarysearch2(arr, target):
	lo = 0
	hi = len(arr) - 1
	while lo <= hi:
		mid = (lo + hi) // 2
		if arr[mid] == target:
			if mid != len(arr) - 1:
				if arr[mid + 1] != target:
					return mid
				else:
					lo += 1
			else:
				return mid
			continue
		if arr[mid] > target:
			hi = mid - 1
		else:
			lo = mid + 1

def nge(arr, n):
	stack = []
	ans = []
	for i in range(n - 1, -1, -1):
		if len(stack) == 0:
			ans.append(-1)
		else:
			while len(stack) > 0:
				if stack[-1][0] < arr[i]:
					stack.pop()
				else:
					break
			if len(stack) == 0:
				ans.append(-1)
			else:
				ans.append(stack[-1][1])
		stack.append([arr[i], i])
	ans.reverse()
	return ans

def nse(arr, n):
	stack = []
	ans = []
	for i in range(n - 1, -1, -1):
		if len(stack) == 0:
			ans.append(-1)
		else:
			while len(stack) > 0:
				if stack[-1][0] > arr[i]:
					stack.pop()
				else:
					break
			if len(stack) == 0:
				ans.append(-1)
			else:
				ans.append(stack[-1][1])
		stack.append([arr[i], i])
	ans.reverse()
	return ans

def alperm(nums, path, result):
	if not nums:
		result.add(tuple(path))
		return
	for i in range(0, len(nums)):
		alperm(nums[:i] + nums[i + 1:], path + [nums[i]], result)
	return result

def minsum(arr, n, m, res, l):
	if n == 1 and m == 1:
		res += arr[0][0]
		l.append(res)
	else:
		if n != 1:
			p = res + arr[n - 1][m - 1]
			minsum(arr, n - 1, m, p, l)
		if m != 1:
			p = res + arr[n - 1][m - 1]
			minsum(arr, n, m - 1, p, l)
	return min(l)

def catalan(n):
	if n == 0 or n == 1:
		return 1
	catalan = [0] * (n + 1)
	catalan[0] = 1
	catalan[1] = 1
	for i in range(2, n + 1):
		for j in range(i):
			catalan[i] += catalan[j] * catalan[i - j - 1]
	return catalan[n]

def find_shortest_path(graph, start, end, path):
	path = path + [start]
	if start == end:
		return path
	if start not in graph:
		return None
	shortest = None
	for node in graph[start]:
		if node not in path:
			newpath = find_shortest_path(graph, node, end, path)
			if newpath:
				if not shortest or len(newpath) < len(shortest):
					shortest = newpath
	return shortest

def test(n, d):
	a = random.randint(1, n - 2)
	p = pow(a, d, n)
	if p == 1 or p == n - 1:
		return True
	while d != n - 1:
		d *= 2
		p = pow(p, 2, n)
		if p == n - 1:
			return True
	return False

def isprime(n):
	if n == 1:
		return False
	if n == 2:
		return True
	if n == 3:
		return True
	d = n - 1
	while d % 2 == 0:
		d //= 2
	for i in range(5):
		if test(n, d) == False:
			return False
	return True

def muin(a, m):
	(x, y, mo) = (1, 0, m)
	if m == 1:
		return 0
	while m > 0:
		(x, y) = (y, x - a // m * y)
		(a, m) = (m, a % m)
	if x < 0:
		return mo + x
	else:
		return x

def good(l, c):
	ch = chr(c)
	if len(l) == 1:
		return 1 if ch != l[0] else 0
	k = len(l) // 2
	lm = k - l[:k].count(ch) + good(l[k:], c + 1)
	rm = k - l[k:].count(ch) + good(l[:k], c + 1)
	return min(lm, rm)

def facto(fact):
	(fact[0], fact[1]) = (1, 1)
	for i in range(2, 10 ** 5 + 1):
		fact[i] = fact[i - 1] * i % M

def comb(n, r, fact):
	return fact[n] * pow(fact[n - r] * fact[r], M - 2, M) % M

def numberToBase(n, b):
	if n == 0:
		return 0
	digits = []
	while n:
		digits.append(n % b)
		n //= b
	return sum(digits)

def main():
	tt = 1
	tt = inpu()
	for _ in range(tt):
		arr = lis()
		arr.sort()
		a = arr[0]
		b = arr[1]
		c = arr[-1] - (arr[0] + arr[1])
		print(a, b, c)
main()


t = int(input())
li = []
for i in range(t):
	n = input()
	li.append(n)
for i in li:
	case = i.split()
	new = []
	for j in case:
		new.append(int(j))
	highest = new.pop(6)
	first = new.pop(0)
	second = new.pop(0)
	third = highest - (first + second)
	print(first, second, third)


l = int(input())
f = []
for a in range(l):
	k = input().split()
	print(f'{k[0]} {k[1]} {int(k[6]) - (int(k[0]) + int(k[1]))}')


n = int(input())
for _ in range(n):
	li = list(map(int, input().split()))
	a = li[0]
	d = li[6]
	li.remove(a)
	li.remove(d - a)
	li.pop()
	aa = li.copy()
	print(a, end=' ')
	t = False
	i = 0
	while i < 3 and (not t):
		for j in range(i, 3):
			if not t:
				if li[i] + li[j] == d - a:
					print(li[i], end=' ')
					print(li[j], end='\n')
					t = True
		i += 1


testcases = input('')
for i in range(0, int(testcases)):
	string = input('')
	nums = string.split(' ')
	a1 = int(nums[0])
	a2 = int(nums[1])
	a23 = int(nums[-2])
	for num in nums[2:]:
		if a23 - a2 == int(num):
			a3 = int(num)
	print(a1, a2, a3)


tc = int(input())
for _ in range(tc):
	b = list(map(int, input().split()))
	b.sort()
	a = []
	a.append(b[0])
	a.append(b[1])
	if a[0] + a[1] == b[2]:
		a.append(b[3])
	else:
		a.append(b[2])
	print(*a)


t = int(input())
for t in range(0, t):
	(a1, a2, a3, a4, a5, a6, a7) = map(int, input().split())
	sorta = [a1, a2, a3, a4, a5, a6, a7]
	sorta.sort()
	c = sorta[6] - (sorta[1] + sorta[0])
	print(sorta[0], sorta[1], c)


t = int(input())
ans = ''
for i in range(t):
	b = list(map(int, input().split()))
	a1 = b[0]
	a2 = b[1]
	a3 = b[6] - b[0] - b[1]
	ans += str(a1) + ' ' + str(a2) + ' ' + str(a3) + '\n'
print(ans)


for stri in [*open(0)][1:]:
	(i, j, *_, m) = map(int, stri.split())
	print(i, j, m - i - j)


t = int(input())
for i in range(t):
	l = list(map(int, input().split()))
	if l[0] + l[1] + l[2] == l[6]:
		print(l[0], l[1], l[2])
	else:
		print(l[0], l[1], l[3])


inp = int(input())
for i in range(inp):
	list1 = input().split()
	m = int(list1[-1]) - (int(list1[0]) + int(list1[1]))
	x = str(list1[0]) + ' ' + str(list1[1]) + ' ' + str(m)
	print(x)


test = int(input())
for i in range(test):
	b = input().split()
	summ = 0
	left = len(b) // 2 + 1
	for i in range(len(b[0:4])):
		if int(b[i]) + int(b[i + 1]) == int(b[i + 2]):
			print(b[i], b[i + 1], b[i + 3])
			break
		else:
			print(b[i], b[i + 1], b[i + 2])
			break


test = int(input())
ans = ''
temp = 0
for i in range(test):
	j = 0
	s = input()
	arr = s.split()
	ans += arr[0] + ' ' + arr[1] + ' ' + str(int(arr[6]) - (int(arr[0]) + int(arr[1]))) + '\n'
print(ans)


tc = int(input())
for i in range(tc):
	a = list(map(int, input().split()))
	s = a[-1]
	n = len(a)
	for i in range(0, n - 1):
		l = i + 1
		r = n - 1
		x = a[i]
		while l < r:
			if x + a[l] + a[r] == s:
				print(x, a[l], a[r])
				break
			elif x + a[l] + a[r] < s:
				l = l + 1
			else:
				r = r - 1


for _ in range(int(input())):
	arr = []
	(a, b, c, d, e, f, g) = map(int, input().split())
	l = [a, b, c, d, e, f, g]
	li = [a, b, c, a + b, b + c, a + c, a + b + c]
	li.sort()
	l.sort()
	if l == li:
		print(a, b, c)
	else:
		print(a, b, d)


for i in range(int(input())):
	a2 = []
	a = list(map(int, input().strip().split()))
	c = a[6] - (a[0] + a[1])
	a2.append(a[0])
	a2.append(a[1])
	a2.append(c)
	print(*a2, sep=' ')


def fun(test_arr):
	a = []
	a.append(test_arr[0])
	largest_sum = int(test_arr[-1]) - int(test_arr[0])
	for i in range(1, 7):
		for j in range(1, 7):
			if i != j:
				if int(test_arr[i]) + int(test_arr[j]) == largest_sum:
					a.append(test_arr[i])
					a.append(test_arr[j])
					break
		s = a[0] + ' ' + a[1] + ' ' + a[2]
	return s
T = int(input())
r = []
for p in range(T):
	r1 = input()
	r.append(r1.split())
for q in range(T):
	print(fun(r[q]))


for _ in range(int(input())):
	a = list(map(int, input().split()))
	print(a[0], a[1], a[6] - a[0] - a[1])


t = int(input())
for _ in range(t):
	a = list(map(int, input().split()))
	a1 = a[0]
	a2 = a[1]
	c = 0
	if a1 + a2 == a[2]:
		a3 = a[3]
	else:
		a3 = a[2]
	print(a1, a2, a3)


test = int(input())
ans = list(range(10))
for i in range(1, test + 1, 1):
	b = [int(j) for j in input().split()]
	ans[0] = b[0]
	ans[1] = b[1]
	if b[2] == b[0] + b[1]:
		ans[2] = b[3]
	else:
		ans[2] = b[2]
	for j in range(0, 3, 1):
		print(ans[j], end=' ')
	print()


time = int(input())
for i in range(time):
	ans = []
	inp = list(map(int, input().split()))
	for i in range(2):
		ans.append(min(inp))
		inp.remove(min(inp))
	if min(inp) == sum(ans):
		inp.remove(min(inp))
		ans.append(min(inp))
	else:
		ans.append(min(inp))
	for i in range(3):
		print(ans[i], end=' ')
	print()


def main():
	for _ in range(int(input())):
		b = list(map(int, input().split()))
		b.sort()
		a = []
		a.append(b[0])
		a.append(b[1])
		if b[6] == b[1] + b[2] + b[0]:
			a.append(b[2])
		else:
			a.append(b[3])
		for i in range(3):
			print(a[i])
main()


t = int(input())
for _ in range(t):
	arr = [int(x) for x in input().split()]
	num1 = arr[0]
	num2 = arr[1]
	num3 = arr[-1] - num1 - num2
	print(num1, num2, num3)


n = int(input())
for i in range(n):
	z = list(map(int, input().split()))
	a0 = z[0]
	a1 = z[1]
	a2 = z[6] - a1 - a0
	print(a0, a1, a2)


t = int(input())
for i in range(t):
	b = [int(x) for x in input().split()]
	a1 = b[0]
	a2 = b[1]
	a3 = b[6] - a1 - a2
	print(a1, a2, a3)


for R in range(int(input())):
	convert_list = list(map(int, input().split()))
	if convert_list[1] + convert_list[0] != convert_list[2]:
		print(convert_list[0], convert_list[1], convert_list[2])
	else:
		print(convert_list[0], convert_list[1], convert_list[3])


import itertools
n = int(input())
for m in range(n):
	lst = list(map(int, input().split()))
	kk = []
	pailie = list(itertools.combinations(lst[:-1], 3))
	for j in pailie:
		ans = [j[0] + j[1], j[0] + j[2], j[1] + j[2], j[0], j[1], j[2], j[0] + j[2] + j[1]]
		if sorted(ans) == lst:
			j = map(str, j)
			print(' '.join(j))
			break


for _ in range(int(input())):
	a = list(map(int, input().split()))
	s = set()
	for x in a:
		s.add(x)
	ans = [a[0]]
	i = 1
	while i < len(a):
		if ans[-1] + a[i] in a:
			a.remove(ans[-1] + a[i])
			ans.append(a[i])
			if len(ans) == 3:
				break
		i += 1
	print(ans[0], ans[1], ans[2])


for i in range(int(input())):
	l = list(map(int, input().split()))
	x = l[6] - l[0]
	flag = 0
	for j in range(1, 7):
		if x - l[j] in l:
			ans1 = l[j]
			ans2 = x - l[j]
			break
	print('%d %d %d' % (l[0], ans1, ans2))


for i in range(int(input())):
	l = list(map(int, input().split()))
	a = l[0]
	b = l[1]
	c = l[-1] - a - b
	print(a, b, c)


import sys
t = int(input())
res = []
for i in range(t):
	a = list(map(int, input().split()))
	res.append([a[0], a[1], a[-1] - (a[0] + a[1])])
for i in range(len(res)):
	sys.stdout.write(' '.join(map(str, res[i])) + '\n')


for i in range(int(input())):
	lis = list(map(int, input().split(' ')))
	ans = []
	ans.append(lis[0])
	ans.append(lis[1])
	if lis[0] + lis[1] == lis[2]:
		ans.append(lis[3])
	else:
		ans.append(lis[2])
	print(*ans)


t = int(input())
for i in range(t):
	l1 = list(map(int, input().split()))
	n = max(l1)
	l1.remove(n)
	p = 0
	q = 0
	for x in range(len(l1)):
		for y in range(x + 1, len(l1)):
			for z in range(y + 1, len(l1)):
				if l1[x] + l1[y] + l1[z] == n:
					print(l1[x], l1[y], l1[z])
					p = 1
					break
			if p == 1:
				q = 1
				break
		if q == 1:
			break


cases = int(input())
for i in range(cases):
	ans = []
	sub = list(map(int, input().split()))
	ans = [sub[0], sub[1], sub[6] - sub[0] - sub[1]]
	for i in ans:
		print(i, end=' ')
	print()


n = int(input())
for i in range(n):
	(a, b, c, d, e, f, g) = input().split()
	print(str(int(g) - int(a) - int(b)) + ' ' + a + ' ' + b)


cases = int(input())
finalstring = ''
for case in range(cases):
	caselist = [int(x) for x in input().split(' ')]
	finalstring += f'{caselist[0]} {caselist[1]} {caselist[-1] - (caselist[0] + caselist[1])}\n'
print(finalstring)


t = int(input())
A = []
for i in range(t):
	a = [int(s) for s in input().split(' ')]
	A.append(a)
for i in range(t):
	print(A[i][0], end=' ')
	print(A[i][1], end=' ')
	print(A[i][6] - (A[i][0] + A[i][1]))


import sys
input = sys.stdin.readline
R = []
T = int(input())
for _ in range(T):
	l = list(map(int, input()[:-1].split()))
	(a1, a2) = (l[0], l[1])
	a3 = l[-1] - (a1 + a2)
	R.append(f'{a1} {a2} {a3}')
print('\n'.join(R))


for _ in range(int(input())):
	lst = list(map(int, input().split()))
	print(lst[0], lst[1], lst[-1] - lst[0] - lst[1])


w = int(input())
l = []
for i in range(w):
	t = list(map(int, input().split()))
	l.append(t)
for i in l:
	print(i[0], i[1], i[len(i) - 1] - (i[0] + i[1]))


for t in range(int(input())):
	a = list(map(int, input().split()))
	if a[0] + a[1] != a[2]:
		print(a[0], a[1], a[2])
	else:
		print(a[0], a[1], a[3])


def polycarp(l):
	a = int(l[0])
	b = int(l[1])
	d = int(l[6])
	c = d - b - a
	ret_str = str(a) + ' ' + str(b) + ' ' + str(c)
	print(ret_str)
t = int(input())
str_l = []
for i in range(t):
	a = input()
	str_l.append(a)
for ele in str_l:
	l = ele.split(' ')
	polycarp(l)
a = '5"\n"1 3 4 4 5 7 8","1 2 3 4 5 6 7","300000000 300000000 300000000 600000000 600000000 600000000 900000000","1 1 2 999999998 999999999 999999999 1000000000","1 2 2 3 3 4 5"\n'
b = '\n1 4 3\n4 1 2\n300000000 300000000 300000000\n999999998 1 1\n1 2 2\n    '


def check(l1, l2):
	l3 = [l1[0], l1[1], l1[2], l1[0] + l1[1], l1[0] + l1[2], l1[1] + l1[2], l1[1] + l1[2] + l1[0]]
	return l3 == l2
for _ in range(int(input())):
	l = list(map(int, input().split()))
	l.sort()
	print(l[0], l[1], l[-1] - l[0] - l[1])


t = int(input())
for _ in range(t):
	nove = []
	pole = list(map(int, input().split()))
	nove.append(pole[0])
	nove.append(pole[1])
	pole.remove(pole[0])
	pole.remove(pole[0])
	x = int(nove[0]) + int(nove[1])
	try:
		pole.remove(int(nove[0]) + int(nove[1]))
		nove.append(pole[0])
	except ValueError:
		nove.append(pole[0])
	print(' '.join(map(str, nove)))


for i in range(int(input())):
	a = list(map(int, input().split()))
	w = a[0]
	x = a[1]
	y = a[2]
	z = a[3]
	if w + x == z:
		print(w, x, y)
	elif w + x != z:
		print(w, x, z)


n = int(input())
for i in range(n):
	l = list(map(int, input().split()))
	a = max(l)
	b = l[0] + l[1]
	for i in range(2, len(l)):
		if b + l[i] == a:
			print(l[0], l[1], l[i])
			break


import sys
for _ in range(int(input())):
	A = list((int(x) for x in input().split()))
	A.sort()
	ans = [A[0], A[1]]
	ans.append(A[6] - (A[0] + A[1]))
	print(' '.join((str(x) for x in ans)))


import sys
input = iter(sys.stdin.read().splitlines()).__next__

def solve(B):
	x = B[0]
	y = B[1]
	z = B[-1] - x - y
	return [x, y, z]
TC = int(input())
for tc in range(TC):
	B = list(map(int, input().split()))
	res = solve(B)
	print(' '.join(map(str, res)))


import math
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')
for _ in range(int(input())):
	arr = list(map(int, input().split()))
	a = arr[0]
	b = arr[1]
	if arr[2] == a + b:
		print(a, b, arr[3])
	else:
		print(a, b, arr[2])


t = int(input())
final = []
for i in range(t):
	a = input().split()
	b = [int(x) for x in a]
	b.sort()
	p = b[0]
	q = b[1]
	r = b[-1] - (p + q)
	result = []
	result.append(p)
	result.append(q)
	result.append(r)
	final.append(result)
for j in final:
	for k in j:
		print(k, end=' ')
	print(' ')


t = int(input())
if 1 <= t <= 5000:
	for i in range(1, t + 1):
		arr = list(map(int, input().split()))
		a = arr[0]
		b = arr[1]
		c = arr[6] - a - b
		print(a, b, c)


def solve(numbers):
	one = numbers[-1] - numbers[-2]
	two = numbers[-3] - one
	three = numbers[-1] - one - two
	print(one, two, three)
t = int(input())
for _ in range(t):
	a = list(map(int, input().split()))
	solve(a)


t = int(input())
for _ in range(t):
	(a, s, d, f, g, h, j) = map(int, input().split())
	if a + s == d and d != f:
		print(a, s, f)
	else:
		print(a, s, d)


n = int(input())
for _ in range(n):
	arr = [int(x) for x in input().split()]
	if arr[0] + arr[1] == arr[2]:
		ans = [arr[0], arr[1], arr[3]]
	else:
		ans = [arr[0], arr[1], arr[2]]
	print(*ans)


t = int(input())
for i in range(t):
	lst = list(map(int, input().split()))
	lsta = lst[:2]
	n = lst[6] - sum(lsta)
	for j in lst[2:]:
		if j == n:
			lsta.append(j)
			break
	print(*lsta)


import math, sys
from collections import defaultdict, deque
import bisect as bi

def yes():
	print('YES')

def no():
	print('NO')

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

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

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

def dict(a):
	d = {}
	for x in a:
		if d.get(x, -1) != -1:
			d[x] += 1
		else:
			d[x] = 1
	return d

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

def main():
	try:
		l = list(In())
		ans = []
		for i in range(7):
			for j in range(7):
				for k in range(7):
					if i != j and j != k and (i != k) and (l[i] + l[j] + l[k] == l[-1]):
						print(l[i], l[j], l[k])
						return
	except:
		pass
M = 998244353
P = 1000000007
for _ in range(I()):
	main()


def func(b):
	a = []
	b.sort()
	a.append(b[0])
	a.append(b[1])
	a.append(b[-1] - b[0] - b[1])
	for i in a:
		print(i, end=' ')
for i in range(int(input())):
	a = map(int, input().split())
	b = list(a)
	func(b)


for _ in range(int(input())):
	nums = list(map(int, input().split()))
	nums.sort()
	result = []
	for i in range(len(nums) - 2):
		if i > 0 and nums[i] == nums[i - 1]:
			continue
		l = i + 1
		r = len(nums) - 1
		while l < r:
			sum = nums[i] + nums[l] + nums[r]
			if sum < nums[-1]:
				l += 1
			elif sum > nums[-1]:
				r -= 1
			else:
				result.append([nums[i], nums[l], nums[r]])
				while l < len(nums) - 1 and nums[l] == nums[l + 1]:
					l += 1
				while r > 0 and nums[r] == nums[r - 1]:
					r -= 1
				l += 1
				r -= 1
	for i in range(len(result[0])):
		print(result[0][i], end=' ')
	print()


import os

def func(s):
	s += ' '
	arr = []
	ch = ''
	for i in s:
		if i != ' ':
			ch += i
		else:
			arr.append(int(ch))
			ch = ''
	c = arr[0] + arr[1]
	i = 2
	arr2 = []
	arr2.append(arr[0])
	arr2.append(arr[1])
	while c + arr[i] != arr[len(arr) - 1]:
		i += 1
	else:
		arr2.append(arr[i])
	return arr2
m = int(input())
result = []
for i in range(m):
	result.append(func(input()))
for i in result:
	print(str(i[0]) + ' ' + str(i[1]) + ' ' + str(i[2]) + '\n')


t = int(input().strip())
for j in range(t):
	numbers = [int(i) for i in input().strip().split()]
	print(numbers[0], end=' ')
	print(numbers[1], end=' ')
	print(numbers[6] - numbers[0] - numbers[1])


import sys
input = sys.stdin.readline

def print(*args, end='\n', sep=' ') -> None:
	sys.stdout.write(sep.join(map(str, args)) + end)

def solve() -> None:
	a = list(map(int, input().split()))
	print(a[0], a[1], a[-1] - a[0] - a[1])

def main() -> None:
	t = int(input())
	for _ in range(t):
		solve()
main()


t = int(input())
for i in range(t):
	k = []
	z = []
	a = list(map(int, input().split()[:7]))
	a.sort()
	k = a[-1] - (a[0] + a[1])
	z = [str(a[0]), str(a[1])]
	a.pop(0)
	a.pop(0)
	for i in a:
		if i == k:
			z.append(str(i))
			break
	print(' '.join(z))


for t in range(int(input())):
	a = list(map(int, input().split(' ')))
	l = len(a)
	for i in range(l - 2):
		for j in range(i + 1, l - 1):
			for k in range(j + 1, l):
				if a[i] + a[j] + a[k] == max(a):
					print(a[i], a[j], a[k])
					break


test = int(input())
for tt in range(test):
	l = list(map(int, input().split()))
	l.sort()
	print(l[0], l[1], l[-1] - l[0] - l[1])


t = int(input())
while t:
	t -= 1
	dat = list(map(int, input().split()))
	print(dat[0], dat[1], dat[-1] - dat[0] - dat[1])


def BvA(lst):
	x = lst[0]
	y = lst[1]
	summa = lst[-1]
	zy = summa - x
	lst = lst[1:6]
	z = zy - y
	return (str(x), str(y), str(z))
for _ in range(int(input())):
	lst = [int(i) for i in input().split()]
	print(' '.join(BvA(lst)))


input1 = int(input())
for i in range(input1):
	input2 = input().split()
	if int(input2[0]) + int(input2[1]) == int(input2[3]):
		print(input2[0], input2[1], input2[2])
	else:
		print(input2[0], input2[1], input2[3])


def getOrigin(cases):
	res = []
	for i in cases:
		l = len(i) - 1
		x = i[0]
		y = i[1]
		z = i[2]
		if x == y and y != z and (x + y != i[3]):
			z = i[3]
		elif z == x + y:
			z = i[3]
		res.append(' '.join([str(x), str(y), str(z)]))
	return res
tc = int(input())
cases = []
for i in range(tc):
	cs = list(map(int, input().split(' ')))
	cases.append(cs)
lst = getOrigin(cases)
for x in lst:
	print(''.join(x))


def main():

	def solve(a):
		return ' '.join(map(str, [a[0], a[1], a[-1] - a[1] - a[0]]))
	t = int(input())
	ans = []
	for _ in range(t):
		a = [int(x) for x in input().split()]
		ans.append(solve(a))
	print('\n'.join(ans))
import sys, threading
input = sys.stdin.readline
thread = threading.Thread(target=main)
thread.start()
thread.join()


t = int(input())
for i in range(t):
	b = list(map(int, input().split()))
	print(b[0], b[1], b[6] - b[0] - b[1])


for _ in range(int(input())):
	b = list(map(int, input().split()))
	first = b[0]
	last = b[-1]
	res = [first]
	for i in range(1, len(b) - 1):
		for j in range(i + 1, len(b) - 1):
			if b[i] + b[j] == last - first:
				res.append(b[i])
				res.append(b[j])
				break
	print(*res)


t = int(input())
for i in range(t):
	list_b = list(map(int, input().split()))
	a = list_b[0]
	b = list_b[1]
	c = list_b[-1] - a - b
	print(a, b, c)


for s in [*open(0)][1:]:
	(x, y, *_, m) = map(int, s.split())
	print(x, y, m - x - y)


t = int(input())
for i in range(t):
	b = list(map(int, input().split()))
	a = [0, 0, 0]
	a[0] = b[0]
	a[1] = b[1]
	a[2] = b[-1] - b[1] - b[0]
	for j in a:
		print(j, end=' ')


Ntest = int(input())
(listofLists, l) = ([], [])
for i in range(Ntest):
	l.append(input().split())
for i in range(Ntest):
	k = []
	for x in range(len(l[i])):
		k.append(int(l[i][x]))
	listofLists.append(k)
for i in range(Ntest):
	val = [listofLists[i][0], listofLists[i][1]]
	for x in range(2, 7):
		if listofLists[i][0] + listofLists[i][1] + listofLists[i][x] == listofLists[i][6]:
			val.append(listofLists[i][x])
			break
	print(val[0], val[1], val[2])


def find_a(b):
	total = b[6]
	a_1 = b[0]
	a_2 = b[1]
	a_3 = int(total) - int(a_1) - int(a_2)
	print(a_1, a_2, a_3)
t = int(input())
for i in range(t):
	user_input = input().split()
	find_a(user_input)


import sys
input = lambda : sys.stdin.readline().strip()
for _ in range(int(input())):
	(a, b, c, d, e, f, g) = input().split()
	print(str(int(g) - int(a) - int(b)) + ' ' + a + ' ' + b)


for i in range(int(input())):
	a = [int(i) for i in input().split()]
	l = len(a)
	a1 = []
	if sum(a[:3]) == a[-1]:
		print(*a[:3])
	else:
		x = a[:2]
		x.extend([a[3]])
		print(*x)


import math
from bisect import bisect_left as bl
from bisect import bisect_right as br
from math import factorial as f
from math import inf
import queue
from collections import deque
import sys
input = sys.stdin.readline
for _ in range(int(input())):
	arr = list(map(int, input().split()))
	ans = []
	ans.append(arr[0])
	ans.append(arr[1])
	ans.append(arr[2] if arr[0] + arr[1] != arr[2] else arr[3])
	print(' '.join(map(str, ans)))


t = int(input())
for i in range(t):
	a = list(map(int, input().split()))
	a.sort()
	k = [a[0], a[1], a[-1] - a[1] - a[0]]
	print(*k)


import sys
import bisect
from bisect import bisect_left as lb
from bisect import bisect_right as rb
input_ = lambda : sys.stdin.readline().strip('\r\n')
from math import log
from math import gcd
from math import atan2, acos
from random import randint
sa = lambda : input_()
sb = lambda : int(input_())
sc = lambda : input_().split()
sd = lambda : list(map(int, input_().split()))
sflo = lambda : list(map(float, input_().split()))
se = lambda : float(input_())
sf = lambda : list(input_())
flsh = lambda : sys.stdout.flush()
sys.setrecursionlimit(3 * 10 ** 5)
mod = 10 ** 9 + 7
mod1 = 998244353
gp = []
cost = []
dp = []
mx = []
ans1 = []
ans2 = []
special = []
specnode = []
a = 0
kthpar = []

def dfs2(root, par):
	if par != -1:
		dp[root] = dp[par] + 1
	for i in range(1, 20):
		if kthpar[root][i - 1] != -1:
			kthpar[root][i] = kthpar[kthpar[root][i - 1]][i - 1]
	for child in gp[root]:
		if child == par:
			continue
		kthpar[child][0] = root
		dfs(child, root)
ans = 0
a = []
(n, k) = (0, 0)
b = []
vis = []
tot = 0
time = []
time1 = []
adj = []
mx = -1
eps = 1e-07
x = 0
pref = []
lvl = []
gp = []
ans = []
f = 0
w = []

def dfs(i, prod, rem, n):
	if rem == 0:
		while i < len(n):
			prod *= int(n[i])
			i += 1
		return prod
	if i == len(n):
		return prod
	mx = 0
	for j in range(9 - int(n[i])):
		mx = max(dfs(i + 1, (int(n[i]) + min(j, rem)) * prod, rem - min(j, rem), n), mx)
	return mx

def hnbhai(tc):
	a = sd()
	x = a[0]
	y = a[1]
	print(x, y, a[-1] - (x + y))
for _ in range(sb()):
	hnbhai(_ + 1)


def poly():
	c = []
	n = c
	for i in range(int(input())):
		a = list(map(int, input().split()))
		n = a
		o = n[0]
		r1 = 1
		r2 = 7
		for j in range(r1, r2):
			for l in range(j + 1, 7):
				if o + n[j] + n[l] == n[6]:
					print(f'{o} {n[l]} {n[j]}')
					break
			o += 1

def sums():
	test = 1
	g = test
poly()


def okay(a):
	return a
for _ in range(int(input())):
	l = list(map(int, input().split()))
	print(l[0], l[1], l[-1] - (l[0] + l[1]))


for _ in range(int(input())):
	b = [int(i) for i in input().split()]
	ans = b[:2] + [b[-1] - sum(b[:2])]
	print(*ans)


t = int(input())
for i in range(t):
	b = []
	b = list(map(int, input().split()))
	c = []
	c.append(b[0])
	c.append(b[1])
	for j in range(2, len(b)):
		if c[0] + c[1] in b and c[0] + b[j] in b and (c[1] + b[j] in b) and (c[0] + c[1] + b[j] == max(b)):
			c.append(b[j])
	for j in range(3):
		print(c[j], end=' ')
	print()


from sys import stdin, stdout

def polycarp(arr):
	first = int(arr[0])
	second = int(arr[1])
	third = int(arr[len(arr) - 1]) - (first + second)
	return f'{first} {second} {third}'
size = int(stdin.readline())
for _ in range(size):
	arr = stdin.readline()
	print(polycarp(arr.split(' ')))


try:
	for i in range(int(input())):
		flag = 0
		arr = list(map(int, input().split()))
		for i in range(4):
			if flag == 1:
				break
			for j in range(i + 1, 5):
				if flag == 1:
					break
				for k in range(j + 1, 6):
					if flag == 1:
						break
					for l in range(k + 1, 7):
						if arr[i] + arr[j] + arr[k] == 2 * arr[l]:
							a = arr[l] - arr[k]
							b = arr[l] - arr[j]
							c = arr[l] - arr[i]
							lst = [a, b, c]
							inc = 0
							flag = 0
							for m in range(7):
								if m != i and m != j and (m != k) and (m != l):
									if lst[inc] == arr[m]:
										inc += 1
							if inc == 3:
								flag = 1
								print(*lst)
								break
except:
	pass


t = int(input())
for _ in range(t):
	a = list(map(int, input().split()))
	for i in range(len(a) - 2):
		for j in range(i + 1, len(a) - 1):
			for k in range(j + 1, len(a)):
				if a[i] + a[j] + a[k] == a[-1]:
					(s1, s2, s3) = (a[i], a[j], a[k])
	print(s1, s2, s3)


for _ in range(int(input())):
	a = [int(i) for i in input().split()]
	a.sort()
	print(a[0], a[1], a[6] - a[0] - a[1])


import sys
n = int(sys.stdin.readline())
for i in range(n):
	series = [int(x) for x in sys.stdin.readline().split()]
	result = series[:2]
	result.append(series[len(series) - 1] - sum(result))
	print(' '.join([str(x) for x in result]))


def main():
	t = int(input())
	for i in range(t):
		entrada = list(map(int, input().split()))
		i = 1
		while i < 3:
			suma = entrada[0] + entrada[i]
			entrada.remove(suma)
			i += 1
		print(*entrada[:3])
main()


t = int(input())
a = []
b = [0, 0, 0]
x = 0
y = 0
z = 0
temp = 0
for i in range(0, t):
	(a1, a2, a3, a4, a5, a6, a7) = input().split()
	a.insert(0, int(a1))
	a.insert(1, int(a2))
	a.insert(2, int(a3))
	a.insert(3, int(a4))
	a.insert(4, int(a5))
	a.insert(5, int(a6))
	a.insert(6, int(a7))
	sum_bc = a[6] - a[0]
	b.insert(0, a[0])
	for j in range(1, 6):
		if j != 1 and a[j] + a[1] == sum_bc:
			b.insert(1, a[1])
			b.insert(2, a[j])
			break
		if j != 2 and a[j] + a[2] == sum_bc:
			b.insert(1, a[2])
			b.insert(2, a[j])
			break
		if j != 3 and a[j] + a[3] == sum_bc:
			b.insert(1, a[3])
			b.insert(2, a[j])
			break
		if j != 4 and a[j] + a[4] == sum_bc:
			b.insert(1, a[4])
			b.insert(2, a[j])
			break
		if j != 5 and a[j] + a[5] == sum_bc:
			b.insert(1, a[5])
			b.insert(2, a[j])
			break
	print(*b[0:3], sep=' ')


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')
from collections import Counter, defaultdict
import math

def nck(n, k):
	res = 1
	for i in range(1, k + 1):
		res = res * (n - i + 1) // i
	return res
mod = 10 ** 9 + 7
import bisect
for _ in range(int(input())):
	arr = list(map(int, input().split()))
	ls = [0, 0, 0]
	ls[0] = arr[0]
	ls[1] = arr[1]
	ls[2] = arr[-1] - ls[0] - ls[1]
	print(*ls)


x = int(input())
for i in range(x):
	(a1, a2, a3, a4, a5, a6, a7) = map(int, input().split())
	print(a7 - a6, a2, a6 - a2)


t = int(input())
if 1 <= t <= 5000:
	for i in range(1, t + 1):
		arr = [int(arr) for arr in input().split()]
		x = max(arr)
		arr1 = []
		a = arr[0]
		b = arr[1]
		c = arr[6] - a - b
		arr1.append(a)
		arr1.append(b)
		arr1.append(c)
		print(*arr1)


for _ in range(int(input())):
	l0 = list(map(int, input().split()))
	n = len(l0)
	temp = l0[0] + l0[1]
	print(l0[0], l0[1], l0[n - 1] - temp)


n = int(input())
for i in range(n):
	a = list(map(int, input().split()))
	c = a[0] + a[1]
	if a[2] == c:
		print(a[0], a[1], a[3])
	else:
		print(a[0], a[1], a[2])


user1 = int(input())
for z in range(user1):
	user2 = input().split()
	lst = []
	for i in user2:
		lst.append(int(i))
	lst2 = [lst[0], lst[1]]
	for i in range(2, len(lst)):
		if lst[0] + lst[1] + lst[i] == lst[-1]:
			lst2.append(lst[i])
			break
	for j in lst2:
		print(j, end=' ')
	print()


def solve():
	a = [int(i) for i in input().split()]
	q = a[0]
	w = a[-1] - q
	for i in range(1, 6):
		for j in range(1, 6):
			if a[i] + a[j] == w:
				return ' '.join([str(i) for i in [q, a[i], a[j]]])
t = int(input())
ans = []
while t:
	ans.append(str(solve()))
	t -= 1
print('\n'.join(ans))


class Solution:

	def restore(self, arr):
		x1 = arr[-1] - arr[-2]
		x3 = arr[-3] - x1
		x2 = arr[-2] - x3
		return [x1, x2, x3]
t = int(input())
rs = []
for _ in range(t):
	rs.append(list(map(int, input().split())))
sol = Solution()
for r in rs:
	print(*sol.restore(r))


a = int(input())
for i in range(a):
	b = input()
	b1 = b.split(' ')
	if int(b1[0]) + int(b1[1]) == int(b1[2]):
		print(b1[0], b1[1], b1[3])
	else:
		print(b1[0], b1[1], b1[2])


t = int(input())
for _ in range(t):
	arr = list(map(int, input().split()))
	(x, y) = (arr[0], arr[1])
	if arr[2] == x + y:
		z = arr[3]
	else:
		z = arr[2]
	print(x, y, z)


def solve(l):
	ans = []
	for a in l:
		for b in l[1:]:
			for c in l[2:]:
				if a + b + c == max(l):
					ans.append(a)
					ans.append(b)
					ans.append(c)
					return ans
t = int(input())
for i in range(t):
	l = list(map(int, input().strip().split()))
	for ele in solve(l):
		print(ele, end=' ')
	print()


for _ in range(int(input())):
	p = 7
	y = list(map(int, input().split()))
	k = y[p - 1]
	a = k - y[p - 2]
	b = k - y[p - 3]
	c = k - (a + b)
	print(a, b, c)


def polycarp_sum(arr):
	a = [0, 0, 0]
	a[0] = arr[0]
	a[1] = arr[1]
	a[2] = arr[6] - arr[0] - arr[1]
	return f'{a[0]} {a[1]} {a[2]}'
t = int(input())
for _ in range(0, t):
	arr = list(map(int, input().rstrip().split()))
	response = polycarp_sum(arr)
	print(f'{response}')


for _ in range(int(input())):
	l = list(map(int, input().split()))
	a1 = l[0]
	a2 = l[1]
	a3 = l[-1] - a1 - a2
	print(a1, a2, a3, end=' ')
	print()


n = int(input())
for i in range(n):
	(a, b, c, d, e, f, g) = map(int, input().split())
	m = a + b
	if m == d:
		print(a, b, c)
	else:
		print(a, b, d)


nb = input()
m = []
for i in range(int(nb)):
	a = list(map(int, input().split()))
	m.append(a)
for l in m:
	n = max(l)
	a = 0
	b = 0
	c = 0
	for i in range(len(l) - 2):
		for j in range(i + 1, len(l) - 1):
			for k in range(j + 1, len(l)):
				if l[i] + l[j] + l[k] == n:
					a = l[i]
					b = l[j]
					c = l[k]
	print(str(a) + ' ' + str(b) + ' ' + str(c))


t = int(input())
for _ in range(t):
	row = input().split()
	ints = list(map(int, row))
	a = 0
	b = 1
	for c in range(2, 5):
		tot = ints[a] + ints[b] + ints[c]
		if tot == ints[-1]:
			print(ints[a], ints[b], ints[c])
			break


from __future__ import print_function
from math import *
from collections import deque
import os
import sys
from io import BytesIO, IOBase

def main():
	pass
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')
mod = 10 ** 9 + 7

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

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

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

def invr():
	return map(int, input().split())
for _ in range(inp()):
	l = inlt()
	a = l[0]
	b = l[1]
	if a + b == l[2]:
		c = l[3]
	else:
		c = l[2]
	print(a, b, c)


for _ in range(int(input())):
	arr = [int(x) for x in input().split()]
	for i in range(7):
		for j in range(i + 1, 7):
			for k in range(j + 1, 7):
				a = arr[i] + arr[j]
				b = arr[i] + arr[k]
				c = arr[j] + arr[k]
				d = arr[i] + arr[j] + arr[k]
				brr = arr.copy()
				brr.remove(arr[i])
				brr.remove(arr[j])
				brr.remove(arr[k])
				if a in brr and b in brr and (c in brr) and (d in brr):
					print(arr[i], arr[j], arr[k])
					f = 1
					break
			if f == 1:
				break
		if f == 1:
			break


n = int(input())
for _ in range(n):
	a = list(map(int, input().strip().split()))
	c = a[6] - (a[0] + a[1])
	print(a[0], end=' ')
	print(a[1], end=' ')
	print(c)


import sys

def solve(arr):
	print(arr[0], arr[1], arr[6] - arr[0] - arr[1])

def main():
	test_case = int(sys.stdin.readline())
	for tc in range(test_case):
		arr = [int(a) for a in sys.stdin.readline().split()]
		solve(arr)
main()


for _ in range(int(input())):
	b = list(map(int, input().strip().split()))
	x = b[0]
	y = b[1]
	z = b[-1] - x - y
	print(x, y, z)


n = int(input())
B = [list(map(int, input().split())) for _ in range(n)]
for b in B:
	a1 = b[0]
	a2 = b[1]
	a3 = b[-1] - a1 - a2
	print(a1, a2, a3)


import itertools
sr = lambda : input()
ir = lambda : int(sr())
lr = lambda : list(map(int, sr().split()))
inf = 10 ** 18
mod = 998244353
test = ir()
for t in range(test):
	a = lr()
	max_num = a[-1]
	kouho = list(itertools.combinations(a[:6], 3))
	for k in kouho:
		(x, y, z) = k
		if x + y + z == max_num:
			print(x, y, z)
			break


from itertools import combinations
for _ in range(int(input())):
	l = list(map(int, input().split()))
	comb = combinations(l, 3)
	for i in comb:
		h = [i[0], i[1], i[2], i[0] + i[1], i[0] + i[2], i[1] + i[2], i[1] + i[0] + i[2]]
		h.sort()
		if h == l:
			print(*i)
			break


tc = int(input())
for case in range(tc):
	my_b = [int(i) for i in input().split()]
	first = my_b[0]
	second = my_b[1]
	total_sum = my_b[6]
	third = total_sum - first - second
	print(first, second, third)


for jkfd in range(int(input())):
	a = list(map(int, input().split()))
	x = a[0]
	y = a[1]
	if x + y == a[2]:
		z = a[3]
	else:
		z = a[2]
	print(x, y, z)


for _ in range(int(input())):
	b = list(map(int, input().split()))
	panjang = len(b)
	s = max(b)
	p1 = 0
	p2 = 0
	p3 = 0
	for i in range(panjang - 2):
		for j in range(i + 1, panjang - 1):
			for k in range(j + 1, panjang):
				if b[i] + b[j] + b[k] == s:
					p1 = b[i]
					p2 = b[j]
					p3 = b[k]
	print(str(p1) + ' ' + str(p2) + ' ' + str(p3))


test = int(input())
while test > 0:
	test -= 1
	arr = list(map(int, input().split()))
	ans = [arr[0], arr[1]]
	if arr[0] + arr[1] == arr[2]:
		ans.append(arr[3])
	else:
		ans.append(arr[2])
	for num in ans:
		print(num, end=' ')
	print()


for _t in range(int(input())):
	(n, m, o, p, q, r, s) = map(int, input().split())
	print(n, end=' ')
	print(m, end=' ')
	print(s - n - m)


t = int(input())
for _ in range(t):
	b = [int(x) for x in input().split()]
	bOccuranceMap = {}
	for i in range(len(b)):
		if i == 0:
			continue
		if b[i] not in bOccuranceMap:
			bOccuranceMap[b[i]] = 0
		bOccuranceMap[b[i]] += 1
	for i in range(len(b)):
		if i == 0:
			continue
		ans = b[-1] - b[0] - b[i]
		if ans in bOccuranceMap and bOccuranceMap[ans] > 0:
			bOccuranceMap[ans] -= 1
			if bOccuranceMap[b[i]] > 0:
				bOccuranceMap[b[i]] -= 1
				print(b[0], b[i], ans)
				break
			else:
				bOccuranceMap[ans] += 1


for i in range(int(input())):
	arrayB = list(map(int, input().split()))
	for j in range(len(arrayB)):
		if arrayB[0] + arrayB[1] + arrayB[j] == arrayB[-1]:
			print(arrayB[0], arrayB[1], arrayB[j])
			break


t = int(input())
for _ in range(t):
	A = list(map(int, input().split()))
	out = []
	out.extend(A[:2])
	if A[2] < sum(out) or sum(out) < A[2]:
		out.append(A[2])
	else:
		out.append(A[3])
	print(*out)


t = int(input())
for i in range(t):
	b = list(map(int, input().split()))
	a = [None] * 3
	a[0] = b[0]
	a[1] = b[1]
	a[2] = b[6] - a[0] - a[1]
	print(*a)


for m in range(int(input())):
	br = list(map(int, input().split()))
	satish = len(br)
	s = max(br)
	ar1 = 0
	ar2 = 0
	ar3 = 0
	for i in range(satish - 2):
		for j in range(i + 1, satish - 1):
			for k in range(j + 1, satish):
				if br[i] + br[j] + br[k] == s:
					ar1 = br[i]
					ar2 = br[j]
					ar3 = br[k]
	print(str(ar1) + ' ' + str(ar2) + ' ' + str(ar3))


def func(arr):
	a = arr[0]
	b = arr[1]
	c = arr[-1] - (a + b)
	return str(a) + ' ' + str(b) + ' ' + str(c)
n = int(input())
while n > 0:
	arr = list(map(int, input().split()))
	print(func(arr))
	n -= 1


tst = int(input())
for i in range(tst):
	arr = list(map(int, input().split()))
	if sum(arr[:3]) == arr[-1]:
		print(*arr[:3])
	else:
		print(arr[0], arr[1], arr[3])


import sys
import math
import bisect
import heapq
from bisect import bisect_right
from sys import stdin, stdout

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

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

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

def get_list_of_list(n):
	return [list(map(int, sys.stdin.readline().strip().split())) for _ in range(n)]

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

def myceil(x, y):
	return (x + y - 1) // y

def check(v, arr):
	tmp = [c for c in v]
	for i in range(3):
		for j in range(i + 1):
			tmp.append(v[i] + v[j])
	tmp.append(sum(v))
	f = 1
	for c in arr:
		f = 0
		for k in tmp:
			if k == c:
				f = 1
				break
	if f:
		return True
	else:
		return False

def Solution(arr):
	res = []
	for i in range(7):
		for j in range(i + 1, 7):
			for k in range(j + 1, 7):
				res.append([arr[i], arr[j], arr[k]])
	for v in res:
		if check(v, arr):
			print(*v)
			return

def main():
	for _ in range(get_int()):
		arr = get_ints_in_list()
		Solution(arr)
main()


t = int(input())
for _ in range(t):
	mas = list(map(int, input().split()))
	a = mas[0]
	b = mas[1]
	c = mas[6] - a - b
	print(a, b, c)


for _ in range(int(input())):
	(a, b, c, d, e, f, g) = map(int, input().split())
	print(a, b, g - a - b)


from sys import stdin

def solve():
	for _ in range(int(stdin.readline().strip())):
		B = sorted(list(map(int, stdin.readline().rstrip().split())))
		ans = [B[0], B[1]]
		if B[2] == sum(ans) and B[3] != sum(ans):
			ans.append(B[3])
		else:
			ans.append(B[2])
		print(' '.join(map(str, ans)))
solve()


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
sys.setrecursionlimit(100000000)
inp = lambda : int(input())
strng = lambda : input().strip()
jn = lambda x, l: x.join(map(str, l))
strl = lambda : list(input().strip())
mul = lambda : map(int, input().strip().split())
mulf = lambda : map(float, input().strip().split())
seq = lambda : list(map(int, input().strip().split()))
ceil = lambda x: int(x) if x == int(x) else int(x) + 1
ceildiv = lambda x, d: x // d if x % d == 0 else x // d + 1
flush = lambda : stdout.flush()
stdstr = lambda : stdin.readline()
stdint = lambda : int(stdin.readline())
stdpr = lambda x: stdout.write(str(x))
mod = 1000000007
n = inp()
res = []
for i in range(n):
	arr = seq()
	a = arr[-1] - arr[-2]
	c = arr[-3] - a
	b = arr[-1] - a - c
	res.append((a, b, c))
for item in res:
	print(str(item[0]) + ' ' + str(item[1]) + ' ' + str(item[2]))


t = int(input())
for i in range(t):
	(a, b, c, d, e, f, g) = map(int, input().split())
	print(b, ' ', g - f, ' ', f - b, end='')
	print()


y = int(input())
for i in range(y):
	z = ''
	u = []
	x = list(input().split())
	z += x[0] + ' '
	if int(x[2]) == int(x[0]) + int(x[1]):
		z += x[1] + ' ' + x[3]
	else:
		z += x[1] + ' ' + x[2]
	print(z)


for s in [*open(0)][1:]:
	(a, b, *l) = [*map(int, s.split())]
	print(a, b, l[l[0] - a == 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())
outp = []
x = inp()
for i in range(x):
	lis = inlt()
	a = lis[0]
	b = lis[1]
	if lis[2] == a + b:
		output = [a, b, lis[3]]
	else:
		output = [a, b, lis[2]]
	outp.append(output)
for out in outp:
	print(out[0], out[1], out[2])


import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')
inp = lambda : list(map(int, sys.stdin.readline().rstrip('\r\n').split()))
for _ in range(int(input())):
	a = inp()
	print(a[0], a[1], a[-1] - a[0] - a[1])


t = int(input())
for i in range(t):
	a = list(map(int, input().split()))
	x = a[0]
	y = a[1]
	z = a[2]
	for j in range(3):
		a.pop(0)
	if x + y not in a:
		print(x, y, a[0])
	else:
		print(x, y, z)


t = int(input())
res = []
for i in range(t):
	(x1, x2, x3, x4, x5, x6, x7) = map(int, input().split(' '))
	res.append([x1, x2, x7 - x1 - x2])
for tu in res:
	print(str(tu[0]) + ' ' + str(tu[1]) + ' ' + str(tu[2]))


import sys
import os.path
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
	sys.stderr = open('error.txt', 'w')
depth = 200001
mod = 1000000007
lim = mod * mod
sys.setrecursionlimit(depth)
linp = lambda : list(minp())
minp = lambda : map(int, input().split())
from math import inf, ceil, sqrt, log2, gcd
from collections import defaultdict, deque
dxy = [(1, 0), (-1, 0), (0, 1), (0, -1)]

def expo(a, b):
	if not b:
		return 1
	v = expo(a, b // 2)
	v = v * v % mod
	if b % 2:
		v = v * a % mod
	return v

def modinv(a, b):
	d = expo(b, mod - 2)
	v = a * d % mod
	return v

def checkPrime(n):
	if n < 4:
		return True
	if n % 2 == 0:
		return False
	for i in range(3, int(sqrt(n)) + 1, 2):
		if n % i == 0:
			return False
	return True
for _ in range(int(input())):
	a = linp()
	x = a[0]
	y = a[1]
	z = a[6] - x - y
	print(x, y, z)


for case in range(int(input())):
	arr = [int(x) for x in input().split()]
	a = arr[0]
	s = arr[-1]
	b = arr[1]
	c = s - b - a
	print(a, b, c)


for _ in range(int(input())):
	s = list(map(int, input().split()))
	m = len(s)
	MAX = max(s)
	a1 = 0
	a2 = 0
	a3 = 0
	for i in range(m - 2):
		for j in range(i + 1, m - 1):
			for k in range(j + 1, m):
				if s[i] + s[j] + s[k] == MAX:
					a1 = s[i]
					a2 = s[j]
					a3 = s[k]
	print(a1, a2, a3)


for _ in range(int(input())):
	m = list(map(int, input().split()))
	print(m[len(m) - 1] - m[len(m) - 2], m[len(m) - 1] - m[len(m) - 3], m[len(m) - 1] - (m[len(m) - 1] - m[len(m) - 2] + m[len(m) - 1] - m[len(m) - 3]))


n = int(input())
for i in range(n):
	list1 = list(map(int, input().split()))
	max1 = max(list1)
	if sum(list1[0:3]) == max1:
		print(list1[0], list1[1], list1[2])
	else:
		print(list1[0], list1[1], list1[3])


import sys
inputs = sys.stdin.readlines()
sp = inputs
sp_ = sp[1:]
sp__ = [list(map(lambda i: int(i), item.strip('\n').split(' '))) for item in sp_]
ret = []
for i in sp__:
	i_ = [i[0], i[1], i[-1] - i[0] - i[1]]
	print(f'{i_[0]} {i_[1]} {i_[2]}')


q = int(input())
for _ in range(q):
	arr = [int(a) for a in input().split()]
	a = arr[0]
	b = arr[1]
	c = arr[-1] - a - b
	print(a, b, c)


for _ in range(int(input())):
	list = [int(x) for x in input().split()]
	b = 0
	for j in range(6):
		if b:
			break
		for k in range(5):
			if b:
				break
			for l in range(4):
				if list[j] + list[k + 1] + list[l + 2] == list[6]:
					print(str(list[j]) + ' ' + str(list[k + 1]) + ' ' + str(list[l + 2]))
					b = 1
					break


n = int(input())
for i in range(n):
	a = list(map(int, input().strip().split()))
	list1 = []
	list1.append(a[0])
	list1.append(a[1])
	list1.append(a[6] - a[0] - a[1])
	print(*list1)


import sys
import math
import bisect
import math
from itertools import accumulate
from itertools import combinations
from collections import deque
import string
input = sys.stdin.readline
sys.setrecursionlimit(3000)

def inpit():
	return int(input())

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

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

def inpspit():
	return map(int, input().split())
pow = math.pow
flr = math.floor
ceil = math.ceil
dis = math.hypot

def lcm(a):
	return abs(math.prod(a)) // math.gcd(*a)

def cumulativeSum(input):
	return list(accumulate(input))
from itertools import permutations
perms = lambda x: list(set([''.join(p) for p in permutations(x)]))

def primes(n):
	sieve = [True] * n
	for i in range(3, int(n ** 0.5) + 1, 2):
		if sieve[i]:
			sieve[i * i::2 * i] = [False] * ((n - i * i - 1) // (2 * i) + 1)
	return [2] + [i for i in range(3, n, 2) if sieve[i]]

def all_set(string):
	lt = []
	for i in range(0, len(string) + 1):
		for element in combinations(string, i):
			lt.append(element)
	return l
dx = [1, -1, 0, 0]
dy = [0, 0, 1, -1]

def f(a, b):
	if a == b:
		return True
	else:
		return False
t = inpit()
for q in range(t):
	ar = inplt()
	f = True
	for i in range(0, len(ar)):
		if f:
			for j in range(len(ar)):
				if i != j and f:
					for k in range(len(ar)):
						if i != j and j != k and (i != k) and f:
							if ar[i] + ar[j] + ar[k] == ar[-1]:
								print(*[ar[i], ar[j], ar[k]])
								f = False
								break


t = int(input())
for i in range(t):
	a = [int(x) for x in input().split()]
	for (ind, ai) in enumerate(a):
		if ind == 0:
			a1 = ai
		elif ind == 1:
			a2 = ai
		elif ind == 6:
			a3 = ai - a1 - a2
	print(a1, a2, a3)


import sys

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

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

def p(a):
	return sys.stdout.write(a)
t = single_ints()
for i in range(t):
	arr = list(get_ints())
	print(arr[0], arr[1], arr[6] - arr[0] - arr[1])


test = int(input())
ans = ''
for i in range(test):
	s = input().split(' ')
	ans += s[0] + ' ' + s[1] + ' ' + str(int(s[6]) - (int(s[0]) + int(s[1]))) + '\n'
print(ans)


output0 = []
output1 = []
output2 = []

def solveFn(nums):
	arr = nums.split()
	for elem in range(len(arr)):
		arr[elem] = int(arr[elem])
	if arr[0] + arr[1] + arr[2] == arr[6]:
		a = arr[0]
		b = arr[1]
		c = arr[2]
	else:
		a = arr[0]
		b = arr[1]
		c = arr[6] - (a + b)
	output0.append(a)
	output1.append(b)
	output2.append(c)

def printFn(n):
	for i in range(n):
		print(output0[i], end=' ')
		print(output1[i], end=' ')
		print(output2[i], end=' ')
		print('\n')
casesN = int(input())
for i in range(casesN):
	numInput = input()
	solveFn(numInput)
printFn(casesN)


for i in range(int(input())):
	arr = [int(x) for x in input().split()]
	a = arr[0]
	b = arr[1]
	c = arr[5] - b
	print(a, end=' ')
	print(b, end=' ')
	print(c)


for i in range(int(input())):
	a = input().split()
	print(a[0], a[1], int(a[-1]) - (int(a[0]) + int(a[1])))


n = int(input())
for i in range(n):
	A = list(map(int, input().split()))
	a = A[-1] - A[-2]
	b = A[-1] - A[-3]
	c = A[-1] - a - b
	print(a, b, c, sep=' ')


for _ in range(int(input())):
	A = list((int(x) for x in input().split()))
	A.sort()
	print(A[0], A[1], A[6] - (A[0] + A[1]))


import math
import sys
import bisect
from itertools import permutations

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

def xd():
	return int(input())

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

def xx(x):
	sys.stdout.write(x)
n = xd()
for i in range(n):
	a = ll()
	for j in range(len(a)):
		for k in range(j + 1, len(a)):
			for b in range(k + 1, len(a)):
				if a[j] + a[k] + a[b] == a[len(a) - 1]:
					print(a[j], a[k], a[b])
					break


def solve():
	for t in range(int(input())):
		arr = list(map(int, input().split()))
		bg = arr[-1]
		a = arr[0]
		b = arr[1]
		c = bg - a - b
		ans = [a, b, c]
		for ele in ans:
			print(ele, end=' ')
		print()
solve()


mahee = int(input())
while mahee > 0:
	mahee -= 1
	v = [int(i) for i in input().split()]
	g = [v[0], v[1], v[-1] - v[0] - v[1]]
	print('%d %d %d' % (g[0], g[1], g[2]))


t = int(input())
while t > 0:
	ls = [int(i) for i in input().split()]
	num1 = ls[0]
	num2 = ls[1]
	num3 = ls[len(ls) - 1] - (num1 + num2)
	print(num1, num2, num3)
	t = t - 1


for s in [*open(0)][1:]:
	(m, *b, M) = map(int, s.split())
	for x in b:
		if {m + x, (y := (M - m - x))} <= {*b}:
			print(m, x, y)
			break


for t in range(int(input())):
	n = [int(x) for x in input().split()]
	a = [n[0], n[1]]
	if sum(a) == n[2]:
		a.append(n[3])
	else:
		a.append(n[2])
	print(' '.join(map(str, a)))


import os
import sys
from io import BytesIO, IOBase
from collections import Counter
from collections import OrderedDict
from collections import defaultdict
import bisect
import math
from sys import setrecursionlimit

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def fre_count(mylist):
	return Counter(mylist)

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

def main():
	t = int(input())
	for _ in range(t):
		arr = [int(x) for x in input().split()]
		set1 = set(arr)
		arr.sort()
		one = arr[0]
		two = arr[1]
		three = None
		arr.remove(one + two)
		for i in range(2, len(arr)):
			flag = True
			set2 = arr.copy()
			if arr[i] + one in set2:
				set2.remove(arr[i] + one)
			else:
				flag = False
			if arr[i] + two in set2:
				set2.remove(arr[i] + two)
			else:
				flag = False
			if flag:
				three = arr[i]
				break
		print(one, two, three)
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))

def input():
	return sys.stdin.readline().rstrip('\r\n')
main()


for _ in range(int(input())):
	a = ''
	b = [int(x) for x in input().split()]
	a += str(b[6] - b[5])
	a += ' '
	a += str(b[5] - b[1])
	a += ' '
	a += str(b[1])
	print(a)


for _ in range(int(input())):
	(a1, a2, a3, a4, a5, a6, a7) = map(int, input().split())
	res = str(a7 - a6) + ' ' + str(a2) + ' ' + str(a6 - a2)
	print(res)


def solve():
	arr = [int(v) for v in input().split()]
	(a, b, c, d) = arr[:4]
	if a + b == c:
		print(a, b, d)
	else:
		print(a, b, c)
t = int(input())
for _ in range(t):
	solve()


n = int(input())
for i in range(n):
	word = input().split()
	a = word[0]
	b = word[1]
	c = int(a) + int(b)
	out = int(word[-1]) - int(c)
	print(a + ' ' + b + ' ' + str(out))


t = int(input())
b = [0] * 7
for i in range(0, t):
	b = list(map(int, input().split()))
	if sum(b) // 4 != b[0] + b[1] + b[2]:
		print(b[0], b[1], b[3], sep=' ')
	else:
		print(b[0], b[1], b[2], sep=' ')


import sys

def solve(li):
	if li[2] == li[0] + li[1]:
		return [li[0], li[1], li[3]]
	else:
		return [li[0], li[1], li[2]]
n = int(input())
for line in sys.stdin:
	numbers = [int(x) for x in line.strip().split()]
	print(*solve(numbers))


def get_ans(nums):
	for i in nums:
		for j in nums[1:]:
			for k in nums[2:]:
				if i + j + k == nums[-1]:
					if i + j in nums:
						if i + k in nums:
							if i + k in nums:
								return f'{i} {j} {k}'
ans = []
for _ in range(int(input())):
	arr = []
	nums = [int(i) for i in input().split()]
	ans.append(get_ans(nums))
print('\n'.join(ans))


t = int(input())
for _ in range(t):
	lista = list(map(int, input().split()))
	pierwsza = lista[0]
	druga = lista[1]
	trzecia = lista[6] - (pierwsza + druga)
	print(pierwsza, druga, trzecia)


for i in range(int(input())):
	l = list(map(int, input().split()))
	print(l[0], l[1], l[-1] - l[0] - l[1])


def misar(a):
	l = []
	s = set()
	mx = max(a)
	mn = min(a)
	l.append(mn)
	p = mx - mn
	for i in range(len(a) - 1):
		temp = p - a[i]
		if temp in s:
			l.append(a[i])
			l.append(temp)
			break
		else:
			s.add(a[i])
	print(*l)
for i in range(int(input())):
	a = list(map(int, input().split()))
	misar(a)


n = int(input())
for i in range(n):
	l = tuple(input().split())
	m1 = l[0]
	m2 = l[1]
	M = l[-1]
	print(' '.join([m1, m2, str(int(M) - int(m1) - int(m2))]))


n = int(input())
for i in range(n):
	l = [int(x) for x in input().split()]
	print(l[0], end=' ')
	print(l[1], end=' ')
	print(l[-1] - (l[0] + l[1]))


import sys

def recreate(b):
	(x, y) = b[0:2]
	if b[2] == str(int(x) + int(y)):
		z = b[3]
	else:
		z = b[2]
	return [x, y, z]

def parseInput():
	inputList = []
	rawInput = sys.stdin.read().split('\n')
	rawInput = rawInput[1:-1]
	for string in rawInput:
		inputList.append(string.split())
	return inputList
for b in parseInput():
	print(' '.join(recreate(b)))


t = int(input())
while t > 0:
	t -= 1
	b = list(map(int, input().strip().split()))
	min = b[0]
	sum = b[6]
	b.remove(min)
	b.remove(sum)
	sum -= b[0]
	b.remove(sum)
	for i in b:
		if i - min in b:
			b.remove(i)
			break
	b.sort()
	b.remove(b[-1])
	b.append(min)
	for i in b:
		print(i, end=' ')
	print('\n', end='')


from sys import stdin

def read_input():
	b = list(map(int, stdin.readline().split()))
	return (b,)

def solve(b):
	x = b[0]
	y = b[1]
	z = b[-1] - x - y
	answer = f'{x} {y} {z}'
	return answer

def main():
	t = int(stdin.readline())
	for _ in range(t):
		input = read_input()
		answer = solve(*input)
		print(answer)
main()


blank = []
number = int(input())
for i in range(0, number):
	xd = input()
	haha = xd.split(' ')
	first = int(haha[0])
	second = int(haha[1])
	third = int(haha[6]) - first - second
	blank.append([first, second, third])
for i in range(0, number):
	print(blank[i][0], blank[i][1], blank[i][2])


n = int(input())
for i in range(n):
	lst = [int(i) for i in input().split()]
	sum_ = sum(lst)
	a = sum_ // 4
	print(lst[0], lst[1], a - lst[0] - lst[1])


def solve():
	a = list(input().split())
	if a[0] == a[1] and a[0] == a[2] or int(a[0]) + int(a[1]) > int(a[2]):
		for i in range(3):
			print(a[i], end=' ')
	else:
		for i in range(4):
			if i == 2:
				continue
			else:
				print(a[i], end=' ')
	print()
for i in range(int(input())):
	solve()


t = int(input())
for y in range(t):
	l = list(map(int, input().split()))
	print(l[6] - l[5], l[1], l[5] - l[1])


n = int(input())
while n > 0:
	n -= 1
	y = [int(i) for i in input().split()]
	x = [y[0], y[1], y[-1] - y[0] - y[1]]
	print('%d %d %d' % (x[0], x[1], x[2]))


from sys import stdin
for testcase in range(int(stdin.readline())):
	values = sorted(map(int, stdin.readline().split()))
	requiredValues = [values[0]]
	for index in range(1, 7):
		if values[index] + requiredValues[0] in values:
			requiredValues.append(values[index])
			break
	requiredValues.append(values[-1] - sum(requiredValues))
	print(*requiredValues)


from sys import stdin, stdout, setrecursionlimit
from math import gcd, sqrt, factorial, pi, inf
from collections import deque, defaultdict
from bisect import bisect, bisect_left
from time import time
from itertools import permutations as per
from heapq import heapify, heappush, heappop, heappushpop
input = stdin.readline
R = lambda : map(int, input().split())
I = lambda : int(input())
S = lambda : input().rstrip('\r\n')
L = lambda : list(R())
P = lambda x: stdout.write(str(x) + '\n')
lcm = lambda x, y: x * y // gcd(x, y)
nCr = lambda x, y: f[x] * inv(f[y] * f[x - y] % N) % N
inv = lambda x: pow(x, N - 2, N)
sumx = lambda x: (x ** 2 + x) // 2
N = 10 ** 9 + 7
for _ in range(I()):
	a = L()
	print(a[0], a[1], a[-1] - (a[0] + a[1]))


import math

def modInverse(p, q):
	mod = 998244353
	expo = 0
	expo = mod - 2
	while expo:
		if expo & 1:
			p = p * q % mod
		q = q * q % mod
		expo >>= 1
	return p

def answer(x, y, li):
	s = []
	for p in range(0, len(li) - 1):
		s.append(li[p + 1] - li[p])
	s.append(int(1e+18))

	def solu(s, fi, y):
		m = 0
		for j in range(0, len(s)):
			m = m + min(s[j], fi)
		return m >= y
	low = 1
	high = int(1e+18)
	ans = 0
	while low < high:
		fi = (low + high) // 2
		if solu(s, fi, y):
			high = fi
			ans = fi
		else:
			low = fi + 1
	return ans
t = int(input())
for i in range(0, t):
	li = input().split()
	print(*[int(li[0]), int(li[1]), int(li[-1]) - int(li[0]) - int(li[1])])


import sys
import math
from itertools import permutations

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

def in1():
	return int(input())
for _ in range(in1()):
	a = get_line()
	c = []
	c.append(a[0])
	c.append(a[1])
	if a[0] + a[1] == a[2]:
		c.append(a[3])
	else:
		c.append(a[2])
	print(*c)


for _ in range(int(input())):
	b = list(map(int, input().split()))
	a = []
	a1 = b[-1] - b[-2]
	a2 = b[-1] - b[-3]
	a3 = b[-1] - a1 - a2
	a.append(a1)
	a.append(a2)
	a.append(a3)
	print(a1, a2, a3)


def main():
	t = int(input())
	while t:
		l = list(map(int, input().split()))
		res = [str(l[0]), str(l[1]), str(l[-1] - l[0] - l[1])]
		print(' '.join(res))
		t -= 1
main()


for _ in range(int(input())):
	ar = list(map(int, input().split()))
	x = ar[0]
	y = ar[1]
	z = ar[-1] - ar[0] - ar[1]
	print(str(x) + ' ' + str(y) + ' ' + str(z))


t = int(input())
for o in range(t):
	a = list(map(int, input().split()))
	print(a[0], a[1], a[len(a) - 1] - (a[0] + a[1]))