The elections in which three candidates participated have recently ended. The first candidate received $a$ votes, the second one received $b$ votes, the third one received $c$ votes. For each candidate, solve the following problem: how many votes should be added to this candidate so that he wins the election (i.e. the number of votes for this candidate was strictly greater than the number of votes for any other candidate)?

Please note that for each candidate it is necessary to solve this problem independently, i.e. the added votes for any candidate do not affect the calculations when getting the answer for the other two candidates.


-----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 containing three integers $a$, $b$, and $c$ ($0 \le a,b,c \le 10^9$).


-----Output-----

For each test case, output in a separate line three integers $A$, $B$, and $C$ ($A, B, C \ge 0$) separated by spaces — the answers to the problem for the first, second, and third candidate, respectively.


-----Examples-----

Input
5
0 0 0
10 75 15
13 13 17
1000 0 0
0 1000000000 0
Output
1 1 1
66 0 61
5 5 0
0 1001 1001
1000000001 0 1000000001


-----Note-----

None

Source: codeforces | Difficulty: EASY
Tags: Mathematics


Solutions:
import sys

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

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

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

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

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

def get_print_int(x):
	sys.stdout.write(str(x) + '\n')

def get_print(x):
	sys.stdout.write(x + '\n')

def get_print_int_same(x):
	sys.stdout.write(str(x) + ' ')

def get_print_same(x):
	sys.stdout.write(x + ' ')
from sys import maxsize

def getAns(main, c1, c2):
	if main > c1 and main > c2:
		return 0
	x = max(c1, c2)
	ans = x - main + 1
	if main + ans > c1 and main + ans > c2:
		return ans
	if main + ans > c1:
		return ans + abs(main - c2 + 1)
	else:
		return ans + abs(main - c1 + 1)

def solve():
	for _ in range(get_int()):
		(a, b, c) = get_ints()
		get_print('{} {} {}'.format(getAns(a, b, c), getAns(b, a, c), getAns(c, a, b)))
solve()


x = int(input())
output = []
for i in range(x):
	(first, second, third) = input().split()
	first = int(first)
	second = int(second)
	third = int(third)
	if first >= second and first >= third:
		if first == second == third:
			output.append('1 1 1')
		elif first == second:
			output.append('1 1 ' + str(first - third + 1))
		elif first == third:
			output.append('1 ' + str(first - second + 1) + ' 1')
		else:
			output.append('0 ' + str(first - second + 1) + ' ' + str(first - third + 1))
	elif second >= first and second >= third:
		if first == second:
			output.append('1 1 ' + str(second - third + 1))
		elif second == third:
			output.append(str(second - first + 1) + ' 1 1')
		else:
			output.append(str(second - first + 1) + ' 0 ' + str(second - third + 1))
	elif third >= first and second <= third:
		if third == first:
			output.append('1 ' + str(third - second + 1) + ' 1')
		elif second == third:
			output.append(str(third - first + 1) + ' 1 1')
		else:
			output.append(str(third - first + 1) + ' ' + str(third - second + 1) + ' 0')
for i in range(len(output)):
	print(output[i])


import sys

def rall():
	return sys.stdin.readlines()

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

def rl_types(types):
	str_list = [x for x in sys.stdin.readline().strip().split(' ')]
	return [types[i](str_list[i]) for i in range(len(str_list))]

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

def pra(array):
	sys.stdout.write(' '.join([str(x) for x in array]) + '\n')

def solve(array):
	return array
NT = int(rl())
for ti in range(NT):
	(a, b, c) = map(int, rl().split(' '))
	m = max(a, b, c)
	tb = 1 if sum([m == i for i in [a, b, c]]) > 1 else 0
	pra([tb if a == m else m - a + 1, tb if b == m else m - b + 1, tb if c == m else m - c + 1])


t = int(input())
arr_input = []
for i in range(t):
	v = input().split(' ')
	arr_input.append([int(v[0]), int(v[1]), int(v[2])])
for i in arr_input:
	arr_output = []
	M = max(i)
	if i.count(M) > 1:
		for j in i:
			arr_output.append(str(M + 1 - j))
	else:
		for j in i:
			if j == M:
				arr_output.append('0')
			else:
				arr_output.append(str(M + 1 - j))
	print(' '.join(arr_output))


m = int(input())
l = []
for _ in range(m):
	(a, b, c) = map(int, input().split())
	bc = max(b, c)
	ab = max(a, b)
	ac = max(a, c)
	if a > bc:
		a = 0
	else:
		a = bc - a + 1
	if b > ac:
		b = 0
	else:
		b = ac - b + 1
	if c > ab:
		c = 0
	else:
		c = ab - c + 1
	l.append(f'{a} {b} {c}')
for i in l:
	print(i)


import sys
input = sys.stdin.readline
T = int(input())
for t in range(T):
	candidates = list(map(int, input().split()))
	max_value = max(candidates)
	count = candidates.count(max_value)
	result = []
	for c in candidates:
		if c == max_value:
			if max_value == 0:
				result.append(1)
			elif count > 1:
				result.append(max_value - c + 1)
			else:
				result.append(0)
		else:
			result.append(max_value - c + 1)
	print(' '.join(map(str, result)))


t = int(input())
suma = [0] * t
sumb = [0] * t
sumc = [0] * t
for i in range(t):
	(a, b, c) = map(int, input().split())
	if a > b and a > c:
		suma[i] = 0
		sumb[i] = a - b + 1
		sumc[i] = a - c + 1
	elif b > a and b > c:
		sumb[i] = 0
		suma[i] = b - a + 1
		sumc[i] = b - c + 1
	elif c > a and c > b:
		suma[i] = c - a + 1
		sumc[i] = 0
		sumb[i] = c - b + 1
	elif a == b and a == c:
		suma[i] = 1
		sumb[i] = 1
		sumc[i] = 1
	elif b == c:
		suma[i] = b - a + 1
		sumb[i] = 1
		sumc[i] = 1
	elif a == b:
		sumc[i] = a - c + 1
		suma[i] = 1
		sumb[i] = 1
	elif a == c:
		sumb[i] = a - b + 1
		suma[i] = 1
		sumc[i] = 1
for j in range(t):
	print(suma[j], sumb[j], sumc[j])


n = int(input())
ans = []
for i in range(n):
	(x1, x2, x3) = map(int, input().split())
	if x1 == x2 and x1 == x3:
		ans.append([1, 1, 1])
	elif x1 == x3:
		if x1 > x2:
			ans.append([1, x1 - x2 + 1, 1])
		else:
			ans.append([x2 - x1 + 1, 0, x2 - x1 + 1])
	elif x1 == x2:
		if x1 > x3:
			ans.append([1, 1, x1 - x3 + 1])
		else:
			ans.append([x3 - x1 + 1, x3 - x1 + 1, 0])
	elif x2 == x3:
		if x1 > x2:
			ans.append([0, x1 - x2 + 1, x1 - x2 + 1])
		else:
			ans.append([x2 - x1 + 1, 1, 1])
	elif x1 > x2 and x1 > x3:
		ans.append([0, x1 - x2 + 1, x1 - x3 + 1])
	elif x2 > x3:
		ans.append([x2 - x1 + 1, 0, x2 - x3 + 1])
	else:
		ans.append([x3 - x1 + 1, x3 - x2 + 1, 0])
for i in range(n):
	print(ans[i][0], ans[i][1], ans[i][2])


def Solve(x, y, z):
	if x == y == z:
		return '{} {} {}'.format(1, 1, 1)
	else:
		arr = []
		zeros = 0
		maxValue = max(x, y, z)
		x = maxValue - x
		y = maxValue - y
		z = maxValue - z
		arr.append(x)
		arr.append(y)
		arr.append(z)
		for value in arr:
			if value == 0:
				zeros += 1
		if zeros > 1:
			return '{} {} {}'.format(x + 1, y + 1, z + 1)
		else:
			if x != 0:
				x += 1
			if y != 0:
				y += 1
			if z != 0:
				z += 1
		return '{} {} {}'.format(x, y, z)
TestCases = int(input())
Results = []
for c in range(TestCases):
	(x, y, z) = [int(x) for x in input().split()]
	Results.append(Solve(x, y, z))
for Result in Results:
	print(Result)


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

def main():
	tests = int(input().rstrip())
	for i in range(tests):
		list_ = list(map(int, input().rstrip().split()))
		max_ = -1
		for i in list_:
			if i > max_:
				max_ = i
		count_ = list_.count(max_)
		for j in list_:
			if j == max_ and count_ == 1:
				output('0 ')
			elif j == max_ and count_ > 0:
				output('1 ')
			else:
				output(str(max_ - j + 1) + ' ')
		output('\n')
main()


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	m = max(a, b, c)
	if a == m and (b == m or c == m):
		print(1, end=' ')
	elif a == m:
		print(0, end=' ')
	elif a < m:
		print(m - a + 1, end=' ')
	if b == m and (a == m or c == m):
		print(1, end=' ')
	elif b == m:
		print(0, end=' ')
	elif b < m:
		print(m - b + 1, end=' ')
	if c == m and (b == m or a == m):
		print(1, end=' ')
	elif c == m:
		print(0, end=' ')
	elif c < m:
		print(m - c + 1, end=' ')
	print()


def main():
	test_cases = int(input())
	ans = [None] * test_cases
	for t in range(test_cases):
		(a, b, c) = map(int, input().split())
		m = max(a, b, c)
		cm = (a, b, c).count(m)

		def calc(x):
			r = m - x
			if x < m or m == 0 or cm > 1:
				r += 1
			return r
		a = [*map(calc, (a, b, c))]
		ans[t] = ' '.join(map(str, a))
	print(*ans, sep='\n')
main()


n = int(input())
s = ''
for i in range(n):
	(a, b, c) = map(int, input().split())
	m = max(a, b, c)
	n = min(a, b, c)
	if a + b + c == 3 * m:
		a = 1
		b = 1
		c = 1
	elif a + b + c - n == 2 * m:
		a = m - a + 1
		b = m - b + 1
		c = m - c + 1
	elif m - a == 0:
		a = 0
		b = m - b + 1
		c = m - c + 1
	elif m - b == 0:
		a = m - a + 1
		b = 0
		c = m - c + 1
	elif m - c == 0:
		a = m - a + 1
		b = m - b + 1
		c = 0
	s += str(a) + ' ' + str(b) + ' ' + str(c) + '\n'
print(s)


amount = int(input())
result = []
for i in range(amount):
	candidates = input().split(' ')
	a = int(candidates[0])
	b = int(candidates[1])
	c = int(candidates[2])
	dif_a = max(0, max(b, c) - a + 1)
	dif_b = max(0, max(a, c) - b + 1)
	dif_c = max(0, max(a, b) - c + 1)
	result.append(' '.join([str(dif_a), str(dif_b), str(dif_c)]))
for i in result:
	print(i)


def main():

	def solve(a):
		mx = -1
		c = 0
		for x in a:
			if x > mx:
				c = 1
				mx = x
			elif x == mx:
				c += 1
		if c == 1:
			return ' '.join(map(str, [mx - x + 1 if x != mx else 0 for x in a]))
		else:
			return ' '.join(map(str, [mx - x + 1 for x in a]))
	t = int(input())
	for _ in range(t):
		a = [int(x) for x in input().split()]
		print(solve(a))
import sys, threading
input = sys.stdin.readline
thread = threading.Thread(target=main)
thread.start()
thread.join()


from sys import stdin
MOD = 10000000000.0 + 7

def rl() -> str:
	return stdin.readline().rstrip()

def ri() -> str:
	return int(rl())

def rii() -> str:
	return list(map(int, rl().split()))

def ok(x, n, a, b):
	c = 0
	for i in range(n):
		if x - 1 - a[i] <= c <= b[i]:
			c += 1
	return c >= x
t = ri()
for _ in range(t):
	(a, b, c) = rii()
	winning = max(a, b, c)
	elections = [a, b, c]
	winners = elections.count(winning)
	if winners == 3:
		print('1 1 1')
		continue
	elif winners == 2:
		ans = ''
		for e in elections:
			if e == winning:
				ans += '1 '
			else:
				ans += str(winning - e + 1) + ' '
		print(ans.strip())
		continue
	elif winners == 1:
		ans = ''
		for e in elections:
			if e == winning:
				ans += '0 '
			else:
				ans += str(winning - e + 1) + ' '
		print(ans.strip())
		continue


n = int(input())
arr = []
for i in range(n):
	tmp = list(map(int, input().split()))
	arr.append(tmp)
for i in arr:
	maxt = max(i)
	if i[0] == i[1] == i[2]:
		print('1 1 1')
	else:
		t = list(map(lambda x: 0 if x == maxt else maxt + 1 - x, i))
		if t.count(0) > 1:
			print(' '.join(list(map(lambda k: str(1) if k == 0 else str(k), t))))
		else:
			print(' '.join(list(map(str, t))))


from sys import stdin
import math

def main():
	t = int(stdin.readline())
	for i in range(t):
		x = list(map(int, stdin.readline().split()))
		l = x.copy()
		l.sort(reverse=True)
		a = l[0]
		fl = 0
		if l[0] == l[1]:
			fl = 1
		out = []
		for j in x:
			if fl:
				out.append(a - j + 1)
			elif j == a:
				out.append(0)
			else:
				out.append(a - j + 1)
		for j in out[:-1]:
			print(j, end=' ')
		print(out[-1])
	return
main()


t = int(input())
ans = []
for i in range(t):
	abc = tuple(map(int, input().split()))
	ans2 = []
	for number in abc:
		if number != max(abc) or abc.count(max(abc)) > 1:
			ans2.append(str(max(abc) - number + 1))
		else:
			ans2.append(str(0))
	ans.append(ans2)
for case in tuple(ans):
	print(' '.join(case).strip())


t = int(input())
answers = []
for i in range(t):
	(a, b, c) = [int(i) for i in input().split()]
	if a > b and a > c:
		A = 0
	elif b > c:
		A = b - a + 1
	else:
		A = c - a + 1
	if b > a and b > c:
		B = 0
	elif a > c:
		B = a - b + 1
	else:
		B = c - b + 1
	if c > a and c > b:
		C = 0
	elif a > b:
		C = a - c + 1
	else:
		C = b - c + 1
	s = f'{A} {B} {C}'
	answers.append(s)
for i in answers:
	print(i)


from sys import stdin
import bisect
input = stdin.readline
ip = lambda : input().rstrip('\n')
IP = lambda : list(map(int, ip().split()))
for i in range(int(ip())):
	(a, b, c) = IP()
	print(max(0, max(b, c) + 1 - a), max(0, max(a, c) + 1 - b), max(0, max(a, b) + 1 - c))


import sys

def input():
	return sys.stdin.readline().rstrip()
t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	print(max(0, max(b, c) - a + 1), max(0, max(a, c) - b + 1), max(0, max(a, b) - c + 1))


import sys
input = sys.stdin.readline
t = int(input())

def solve(x, y, z):
	if x > y and x > z:
		return 0
	return max(x, y, z) - x + 1
for _ in range(t):
	(a, b, c) = map(int, input().split())
	print(solve(a, b, c), solve(b, a, c), solve(c, a, b))


import sys
from math import factorial, gcd
from collections import Counter, deque, defaultdict
from bisect import bisect_left, bisect_right
from heapq import heappop, heappush, heapify, nlargest, nsmallest
from itertools import groupby, accumulate
from copy import deepcopy
MOD = 10 ** 9 + 7
INF = float('inf')
input = sys.stdin.readline
rl = lambda : list(map(int, input().split()))
rs = lambda : sys.stdin.readline().strip()
for _ in range(int(input())):
	(a, b, c) = rl()
	val = max(a, b, c)
	A = 0 if a == val and b != val and (c != val) else val + 1 - a
	B = 0 if b == val and a != val and (c != val) else val + 1 - b
	C = 0 if c == val and a != val and (b != val) else val + 1 - c
	print(A, B, C)


from sys import stdin

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

def solve(a, b, c):
	if a == b and b == c:
		return '1 1 1'
	m = max(max(a, b), c)
	if a == b and b == m:
		a = 1
		b = 1
		c = m - c + 1
	elif a == c and c == m:
		a = 1
		c = 1
		b = m - b + 1
	elif b == c and c == m:
		b = 1
		c = 1
		a = m - a + 1
	else:
		a = m - a + 1 if m != a else 0
		b = m - b + 1 if m != b else 0
		c = m - c + 1 if m != c else 0
	return ' '.join((str(a), str(b), str(c)))

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


t = int(input())
l = []
for i in range(t):
	(a, b, c) = map(int, input().split())
	f = max(a, b, c)
	if f == a and f == b:
		aa = 1
		bb = 1
		cc = abs(c - f) + 1
	elif f == a and f == c:
		aa = 1
		cc = 1
		bb = abs(b - f) + 1
	elif f == b and f == c:
		bb = 1
		cc = 1
		aa = abs(a - f) + 1
	elif f == a and f == b and (f == c):
		aa = 1
		bb = 1
		cc = 1
	elif f != 0:
		if a == f:
			aa = 0
		else:
			aa = abs(a - f) + 1
		if b == f:
			bb = 0
		else:
			bb = abs(b - f) + 1
		if c == f:
			cc = 0
		else:
			cc = abs(c - f) + 1
	else:
		aa = 1
		bb = 1
		cc = 1
	l.append([aa, bb, cc])
for i in l:
	print(*i)


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	(a, b, c) = [int(i) for i in input().split()]
	if a >= max(b, c) + 1:
		print(0, end=' ')
	else:
		print(max(b, c) + 1 - a, end=' ')
	if b >= max(a, c) + 1:
		print(0, end=' ')
	else:
		print(max(a, c) + 1 - b, end=' ')
	if c >= max(a, b) + 1:
		print(0, end=' ')
	else:
		print(max(a, b) + 1 - c, end=' ')
	print()


import sys
t = int(sys.stdin.readline())
while t > 0:
	t -= 1
	abc = [int(i) for i in sys.stdin.readline().split()]
	a = int(abc[0])
	b = int(abc[1])
	c = int(abc[2])
	if a > max(b, c):
		ac = 0
	else:
		diff = max(b, c) - a
		if diff == 0:
			ac = 1
		else:
			ac = diff + 1
	if b > max(a, c):
		bc = 0
	else:
		diff = max(a, c) - b
		if diff == 0:
			bc = 1
		else:
			bc = diff + 1
	if c > max(a, b):
		cc = 0
	else:
		diff = max(a, b) - c
		if diff == 0:
			cc = 1
		else:
			cc = diff + 1
	print(ac, bc, cc)


def solve(a, b, c):
	if a > b and a > c:
		return 0
	if a > b and a <= c:
		return c - a + 1
	if a > c and a <= b:
		return b - a + 1
	m = max(b, c)
	return m - a + 1
t = int(input().strip())
inputs = []
for _ in range(t):
	(a, b, c) = map(int, input().strip().split())
	inputs.append((a, b, c))
for (a, b, c) in inputs:
	print(solve(a, b, c), solve(b, a, c), solve(c, a, b))


import sys
t = int(sys.stdin.readline())
for _ in range(t):
	li = list(map(int, sys.stdin.readline().split()))
	m = max(li)
	c = li.count(m)
	for i in range(3):
		if li[i] == m:
			if c >= 2:
				li[i] = '1'
			else:
				li[i] = '0'
		else:
			li[i] = str(abs(li[i] - m) + 1)
	print(' '.join(li))


import sys
lines = sys.stdin.readlines()
for line in lines[1:]:
	line = list(map(int, line.rstrip().split()))
	s = max(line)
	line = [str(s - l + 1) for l in line]
	count = line.count('1')
	for idx in range(3):
		if count == 1 and line[idx] == '1':
			line[idx] = '0'
	k = ' '.join(line)
	print(k)


import sys

def determine_votes_group(line):
	line = list(map(int, line))
	mostVotes = max(line)
	mVotesCount = 0
	for x in line:
		if x == mostVotes:
			mVotesCount += 1
	candlist = []
	for y in line:
		if y == mostVotes and mVotesCount == 1:
			candlist.append(0)
		elif y != mostVotes:
			candlist.append(mostVotes - y + 1)
		elif y == mostVotes and mVotesCount > 1:
			candlist.append(1)
	candlist = ' '.join(map(str, candlist))
	sys.stdout.write(f'{candlist}\n')
infile = []
for line in sys.stdin:
	if '' == line.rstrip():
		break
	infile.append(line.rstrip().split())
cases = infile[0]
for x in range(1, len(infile)):
	determine_votes_group(infile[x])


Num = int(input())
ans = []
for _ in range(Num):
	l = list(map(int, input().split()))
	l2 = []
	d = max(l)
	if l[0] == l[1] == l[2]:
		l2.extend([1, 1, 1])
	elif l[0] == l[1] == d or l[1] == l[2] == d or l[0] == l[2] == d:
		for i in l:
			if i == d:
				l2.append(1)
			else:
				l2.append(d + 1 - i)
	else:
		for i in l:
			if i == d:
				l2.append(0)
			else:
				l2.append(d + 1 - i)
	ans.append(l2)
for i in ans:
	print(*i, sep=' ')


t = int(input())
ans = []
for i in range(t):
	(a, b, c) = [int(i) for i in input().split()]
	if a > max(b, c):
		a1 = 0
	else:
		a1 = max(b, c) - a + 1
	if b > max(a, c):
		b1 = 0
	else:
		b1 = max(a, c) - b + 1
	if c > max(b, a):
		c1 = 0
	else:
		c1 = max(b, a) - c + 1
	ans.append([a1, b1, c1])
for el in ans:
	print(' '.join([str(i) for i in el]))


n = int(input())
res = []
for _ in range(n):
	s = [int(i) for i in input().split()]
	m = max(s)
	(a, b, c) = s
	s1 = [0 if i == m else 1 for i in s]
	k = s1.count(0)
	if k == 1:
		res.append([m - a + 1 * s1[0], m - b + 1 * s1[1], m - c + 1 * s1[2]])
	else:
		res.append([m - a + 1, m - b + 1, m - c + 1])
for j in res:
	print(*j)


def main():
	import sys
	input = sys.stdin.readline
	M = int(1000000000.0 + 7)
	for _ in range(int(input())):
		l = list(map(int, input().split()))
		m = max(l)
		mn = 0
		if l.count(m) > 1:
			mn = 1
		for i in l:
			if i == m:
				print(mn, end=' ')
			else:
				print(m - i + 1, end=' ')
		print()
main()


n = int(input())
while n != 0:
	(a, b, c) = map(int, input().split())
	if a > b >= c:
		print(0, a - b + 1, a - c + 1)
	elif a > c > b:
		print(0, a - b + 1, a - c + 1)
	elif b > a >= c:
		print(b - a + 1, 0, b - c + 1)
	elif b > c > a:
		print(b - a + 1, 0, b - c + 1)
	elif c > a >= b:
		print(c - a + 1, c - b + 1, 0)
	elif c > b > a:
		print(c - a + 1, c - b + 1, 0)
	elif a >= b > c:
		print(1, 1, a - c + 1)
	elif a >= c > b:
		print(1, a - b + 1, 1)
	elif b >= c > a:
		print(b - a + 1, 1, 1)
	else:
		print(1, 1, 1)
	n = n - 1


t = int(input())
for i in range(t):
	(A, B, C) = map(int, input().split())
	if A >= B and A >= C:
		m = A
	elif B >= A and B >= C:
		m = B
	elif C >= A and C >= B:
		m = C
	if m == B and m == C or (m == A and m == C) or (m == A and m == B):
		print(m - A + 1, m - B + 1, m - C + 1)
	elif A == m:
		print(0, m - B + 1, m - C + 1)
	elif B == m:
		print(m - A + 1, 0, m - C + 1)
	else:
		print(m - A + 1, m - B + 1, 0)


test_cases = int(input())
for case in range(test_cases):
	(vote_a, vote_b, vote_c) = map(int, input().split())
	vote_a_towin = max(0, max(vote_b, vote_c) + 1 - vote_a)
	vote_b_towin = max(0, max(vote_a, vote_c) + 1 - vote_b)
	vote_c_towin = max(0, max(vote_a, vote_b) + 1 - vote_c)
	print(vote_a_towin, vote_b_towin, vote_c_towin)


n = int(input())
for i in range(n):
	(a, b, c) = map(int, input().split())
	x = max(a, b, c)
	if a == b == c:
		print(1, 1, 1)
	elif x == a and x == b:
		print(1, 1, a - c + 1)
	elif x == b and x == c:
		print(b - a + 1, 1, 1)
	elif x == a and x == c:
		print(1, a - b + 1, 1)
	elif x == c:
		print(c - a + 1, c - b + 1, 0)
	elif x == a:
		print(0, a - b + 1, a - c + 1)
	elif x == b:
		print(b - a + 1, 0, b - c + 1)


t = int(input())
l = []
for i in range(t):
	y = input().split()
	l1 = []
	z = []
	for g in range(3):
		z.append(int(y[g]))
	ma = max(z)
	for k in range(3):
		if z[k] < ma:
			l1.append(ma - z[k] + 1)
		elif z[k] == ma:
			c = 0
			for r in range(3):
				if z[r] == ma:
					c += 1
			if c > 1:
				l1.append(1)
			else:
				l1.append(0)
	l.append(l1)
for j in range(t):
	print(l[j][0], l[j][1], l[j][2])


m = []
n = int(input())
for i in range(n):
	l = list(map(int, input().split()))
	x = max(l)
	l2 = list(l)
	l2.remove(x)
	if x == 0:
		m.append([1, 1, 1])
	elif x in l2:
		for i in range(len(l)):
			if l[i] == x:
				l[i] = 1
			else:
				l[i] = x - l[i] + 1
		m.append(l)
	else:
		for i in range(len(l)):
			if l[i] != x:
				l[i] = x - l[i] + 1
			else:
				l[i] = 0
		m.append(l)
for j in m:
	for q in j:
		print(q, end=' ')
	print()


T = int(input())
for i in range(T):
	(a, b, c) = map(int, input().split())
	if a > b and a > c:
		x = 0
	else:
		if b > c:
			x = b + 1 - a
		if c >= b:
			x = c + 1 - a
	if b > a and b > c:
		y = 0
	else:
		if a > c:
			y = a + 1 - b
		if c >= a:
			y = c + 1 - b
	if c > a and c > b:
		z = 0
	else:
		if a > b:
			z = a + 1 - c
		if b >= a:
			z = b + 1 - c
	print(x, y, z)


test = int(input(''))
list1 = []
for x in range(test):
	(a, b, c) = input().split()
	a = int(a)
	b = int(b)
	c = int(c)
	y = max(a, b, c)
	if a == b and b == c:
		list2 = [1, 1, 1]
		list1.append(list2)
	elif a == b and b > c:
		list2 = [1, 1, b - c + 1]
		list1.append(list2)
	elif b == c and b > a:
		list2 = [b - a + 1, 1, 1]
		list1.append(list2)
	elif a == c and a > b:
		list2 = [1, a - b + 1, 1]
		list1.append(list2)
	elif a == b and b < c:
		list2 = [c - b + 1, c - b + 1, 0]
		list1.append(list2)
	elif b == c and b < a:
		list2 = [0, a - b + 1, a - b + 1]
		list1.append(list2)
	elif a == c and a < b:
		list2 = [b - a + 1, 0, b - a + 1]
		list1.append(list2)
	else:
		y = max(a, b, c)
		y = int(y)
		if a == y:
			list2 = [0, y - b + 1, y - c + 1]
			list1.append(list2)
		elif b == y:
			list2 = [y - a + 1, 0, y - c + 1]
			list1.append(list2)
		else:
			list2 = [y - a + 1, y - b + 1, 0]
			list1.append(list2)
for x in range(test):
	for y in range(3):
		print(list1[x][y], ' ', end='')
	print('')


t = int(input())
while t != 0:
	(n, m, p) = map(int, input().split())
	t -= 1
	if n > m and n > p:
		print(0, n - m + 1, n - p + 1)
	elif m > n and m > p:
		print(m - n + 1, 0, m - p + 1)
	elif p > m and p > n:
		print(p - n + 1, p - m + 1, 0)
	elif n == m and n == p:
		print(1, 1, 1)
	elif n == m:
		print(1, 1, n - p + 1)
	elif m == p:
		print(m - n + 1, 1, 1)
	else:
		print(1, n - m + 1, 1)


n = int(input())
a1 = 0
b1 = 0
c1 = 0
for i in range(n):
	(a, b, c) = map(int, input().split())
	if a > b and a > c:
		a1 = 0
		b1 = a - b + 1
		c1 = a - c + 1
	elif b > a and b > c:
		a1 = b - a + 1
		b1 = 0
		c1 = b - c + 1
	elif c > a and c > b:
		a1 = c - a + 1
		b1 = c - b + 1
		c1 = 0
	elif a == b and a != c:
		a1 = a - b + 1
		b1 = a1
		c1 = a - c + 1
	elif a == c and a != b:
		a1 = a - c + 1
		b1 = a - b + 1
		c1 = a1
	elif b == c and b != a:
		a1 = b - a + 1
		b1 = b - c + 1
		c1 = 1
	else:
		(a1, b1, c1) = (1, 1, 1)
	print(a1, b1, c1)


t = int(input())
for i in range(t):
	(a, b, c) = map(int, input().split())
	if a > max(b, c):
		print(0, a - b + 1, a - c + 1)
	elif a == max(b, c):
		print(1, a - b + 1, a - c + 1)
	elif b > max(a, c):
		print(b - a + 1, 0, b - c + 1)
	elif b == max(a, c):
		print(b - a + 1, 1, b - c + 1)
	elif c > max(a, b):
		print(c - a + 1, c - b + 1, 0)
	elif c == max(a, c):
		print(c - a + 1, c - b + 1, 1)


T = int(input())
for t in range(T):
	winlist = []
	(a, b, c) = map(int, input().split(' '))
	great = max(a, b, c)
	for can in [a, b, c]:
		if can != great:
			winlist.append(str(great + 1 - can))
		elif [a, b, c].count(great) > 1:
			winlist.append('1')
		else:
			winlist.append('0')
	print(' '.join(winlist))


n = int(input())
for i in range(n):
	(a, b, c) = map(int, input().split())
	x = 0
	y = 0
	z = 0
	if max(b, c) >= a:
		x = max(b, c) + 1 - a
	if max(a, c) >= b:
		y = max(a, c) + 1 - b
	if max(a, b) >= c:
		z = max(a, b) + 1 - c
	print(x, y, z)


import sys

def main():
	count = int(sys.stdin.readline())
	for i in range(count):
		line = [int(x) for x in sys.stdin.readline().split(' ')]
		mx = max(line)
		count = sum((1 for x in line if x == mx))
		a = max(0, max(line[1], line[2]) + 1 - line[0])
		b = max(0, max(line[0], line[2]) + 1 - line[1])
		c = max(0, max(line[1], line[0]) + 1 - line[2])
		print(a, b, c)
main()


t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	print(max(0, max(b, c) - a + 1), max(0, max(a, c) - b + 1), max(0, max(a, b) - c + 1))


t = int(input())
for i in range(t):
	(w, h, k) = map(int, input().split())
	if w == h and w == k:
		print(1, 1, 1)
	elif w > h and w > k:
		print(0, w - h + 1, w - k + 1)
	elif h > w and h > k:
		print(h - w + 1, 0, h - k + 1)
	elif k > w and k > h:
		print(k - w + 1, k - h + 1, 0)
	elif w == h and w != k:
		if w > k:
			print(1, 1, w - k + 1)
		else:
			print(k - w + 1, k - h + 1, 0)
	elif h == k and h != w:
		if h > w:
			print(h - w + 1, 1, 1)
		else:
			print(0, w - h + 1, w - k + 1)
	elif w == k and w != h:
		if w > h:
			print(1, w - h + 1, 1)
		else:
			print(h - w + 1, 0, h - k + 1)


for s in [*open(0)][1:]:
	a = (*enumerate(map(int, s.split())),)
	print(*(max((y - x + (i != j) for (j, y) in a)) for (i, x) in a))


t = int(input())
for _ in range(t):
	(a, b, c) = [int(i) for i in input().split()]
	if a > b and a > c:
		A = 0
	else:
		A = max(b, c) - a + 1
	if b > a and b > c:
		B = 0
	else:
		B = max(a, c) - b + 1
	if c > b and c > a:
		C = 0
	else:
		C = max(a, b) - c + 1
	print(A, B, C)


n = int(input())
arr = []
for i in range(n):
	arr.append(list(map(int, input().split())))
	ans = []
for i in range(n):
	ans = []
	imax = max(arr[i])
	maxcount = arr[i].count(imax)
	for j in range(3):
		if arr[i][j] == imax and maxcount == 1:
			ans.append(0)
		elif arr[i][j] == imax and maxcount > 0:
			ans.append(1)
		else:
			ans.append(imax - arr[i][j] + 1)
	print(ans[0], ans[1], ans[2])


t = int(input())
for i in range(t):
	(a, b, c) = map(int, input().split())
	x = max(a, b + 1, c + 1) - a
	y = max(a + 1, b, c + 1) - b
	z = max(a + 1, b + 1, c) - c
	print(x, y, z)


for index in range(int(input())):
	(cand1, cand2, cand3) = map(int, input().split(' '))
	if cand1 > cand2 and cand1 > cand3:
		print(0, cand1 - cand2 + 1, cand1 - cand3 + 1)
	elif cand2 > cand3 and cand2 > cand1:
		print(cand2 - cand1 + 1, 0, cand2 - cand3 + 1)
	elif cand3 > cand2 and cand3 > cand1:
		print(cand3 - cand1 + 1, cand3 - cand2 + 1, 0)
	elif cand1 == cand2 and (not cand1 == cand3):
		print(1, 1, cand1 - cand3 + 1)
	elif cand2 == cand3 and (not cand1 == cand3):
		print(cand2 - cand1 + 1, 1, 1)
	elif cand3 == cand1 and (not cand1 == cand2):
		print(1, cand1 - cand2 + 1, 1)
	else:
		print(1, 1, 1)


for i in range(int(input())):
	x = input().split()
	a = int(x[0])
	b = int(x[1])
	c = int(x[2])
	output = ''
	if a <= max(b, c):
		output += str(max(b, c) - a + 1) + ' '
	else:
		output += '0 '
	if b <= max(a, c):
		output += str(max(a, c) - b + 1) + ' '
	else:
		output += '0 '
	if c <= max(b, a):
		output += str(max(b, a) - c + 1) + ' '
	else:
		output += '0 '
	print(output[0:-1])


T = int(input())

def work():
	(a, b, c) = input().split()
	a = int(a)
	b = int(b)
	c = int(c)
	(ans_a, ans_b, ans_c) = (-1, -1, -1)
	ans_a = max(ans_a, max(b - a, c - a))
	ans_b = max(ans_b, max(a - b, c - b))
	ans_c = max(ans_c, max(b - c, a - c))
	print(f'{ans_a + 1} {ans_b + 1} {ans_c + 1}')
for CASE in range(T):
	work()


t = int(input())
for _ in range(t):
	a = [int(x) for x in input().split()]
	m = max(a)
	if a.count(m) == 3:
		for i in range(3):
			a[i] = 1
	elif a.count(m) == 2:
		for i in range(3):
			a[i] = m - a[i] + 1
	else:
		for i in range(3):
			if a[i] < m:
				a[i] -= 1
			a[i] = m - a[i]
	print(' '.join([str(x) for x in a]))


t = int(input())
for _ in range(t):
	arr = input().split(' ')
	(a, b, c) = (int(arr[0]), int(arr[1]), int(arr[2]))
	if a == b and b == c and (c == a):
		print('1 1 1')
	else:
		d = max(a, b, c)
		if d == a and d == b:
			f = a - c + 1
			print('1 1 {}'.format(f))
		elif d == a and d == c:
			f = a - b + 1
			print('1 {} 1'.format(f))
		elif d == b and d == c:
			f = b - a + 1
			print('{} 1 1'.format(f))
		elif d == a:
			print('0 {} {}'.format(a - b + 1, a - c + 1))
		elif d == b:
			print('{} 0 {}'.format(b - a + 1, b - c + 1))
		elif d == c:
			print('{} {} 0'.format(c - a + 1, c - b + 1))


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	if a == b == c:
		print(1, 1, 1)
	elif a == b > c:
		print(1, 1, a - c + 1)
	elif a == c > b:
		print(1, a - b + 1, 1)
	elif b == c > a:
		print(b - a + 1, 1, 1)
	elif a > b and a > c:
		print(0, a - b + 1, a - c + 1)
	elif b > a and b > c:
		print(b - a + 1, 0, b - c + 1)
	elif c > a and c > b:
		print(c - a + 1, c - b + 1, 0)


w = int(input())
l = []
for i in range(w):
	k = list(map(int, input().split()))
	l.append(k)
for i in l:
	ans = []
	for r in range(len(i)):
		other = list(i)
		other.pop(r)
		other.sort()
		if other[len(other) - 1] >= i[r]:
			ans.append(other[len(other) - 1] - i[r] + 1)
		else:
			ans.append(0)
	print(ans[0], ans[1], ans[2])


test_case = int(input())
for _ in range(test_case):
	(a, b, c) = list(map(int, input().split()))
	print(max(a, b + 1, c + 1) - a, max(a + 1, b, c + 1) - b, max(a + 1, b + 1, c) - c)


def eachcase():
	c = list(map(int, input().split()))
	mx = max(c)
	if mx == 0:
		print('1 1 1')
		return
	r = [0, 0, 0]
	if c[0] == mx:
		if c[0] == c[1] or c[0] == c[2]:
			r[0] = 1
		else:
			r[0] = 0
	else:
		r[0] = mx - c[0] + 1
	if c[1] == mx:
		if c[1] == c[0] or c[1] == c[2]:
			r[1] = 1
		else:
			r[1] = 0
	else:
		r[1] = mx - c[1] + 1
	if c[2] == mx:
		if c[2] == c[1] or c[2] == c[0]:
			r[2] = 1
		else:
			r[2] = 0
	else:
		r[2] = mx - c[2] + 1
	print(str(r[0]) + ' ' + str(r[1]) + ' ' + str(r[2]))

def main():
	tcs = int(input())
	for tc in range(tcs):
		eachcase()
main()


for i in range(int(input())):
	(a, b, c) = map(int, input().split())
	print(max(a, b + 1, c + 1) - a, max(a + 1, b, c + 1) - b, max(a + 1, b + 1, c) - c)


a = int(input())
for i in range(a):
	b = [int(i) for i in input().split()]
	e = max(b)
	c = []
	for j in b:
		if b.count(j) > 1:
			c.append(str(e - j + 1))
		elif e - j != 0:
			c.append(str(e - j + 1))
		else:
			c.append(str(e - j))
	print(' '.join(c))


t = int(input())
for i in range(t):
	(a, b, c) = map(int, input().split())
	A = max(a, b + 1, c + 1) - a
	B = max(a + 1, b, c + 1) - b
	C = max(a + 1, b + 1, c) - c
	print(A, B, C)