Yura is tasked to build a closed fence in shape of an arbitrary non-degenerate simple quadrilateral. He's already got three straight fence segments with known lengths $a$, $b$, and $c$. Now he needs to find out some possible integer length $d$ of the fourth straight fence segment so that he can build the fence using these four segments. In other words, the fence should have a quadrilateral shape with side lengths equal to $a$, $b$, $c$, and $d$. Help Yura, find any possible length of the fourth side.

A non-degenerate simple quadrilateral is such a quadrilateral that no three of its corners lie on the same line, and it does not cross itself.


-----Input-----

The first line contains a single integer $t$ — the number of test cases ($1 \le t \le 1000$). The next $t$ lines describe the test cases.

Each line contains three integers $a$, $b$, and $c$ — the lengths of the three fence segments ($1 \le a, b, c \le 10^9$).


-----Output-----

For each test case print a single integer $d$ — the length of the fourth fence segment that is suitable for building the fence. If there are multiple answers, print any. We can show that an answer always exists.


-----Example-----
Input
2
1 2 3
12 34 56

Output
4
42



-----Note-----

We can build a quadrilateral with sides $1$, $2$, $3$, $4$.

We can build a quadrilateral with sides $12$, $34$, $56$, $42$.

Difficulty: MEDIUM

Starter code:

Solutions:
for k in range(int(input())):
	t = list(map(int, input().split()))
	print(max(t) + 1)


from sys import stdin, stdout
from math import gcd, sqrt, factorial, pi, inf
from collections import deque, defaultdict
input = stdin.readline
R = lambda : map(int, input().split())
I = lambda : int(input())
S = lambda : input().rstrip('\n')
L = lambda : list(R())
P = lambda x: stdout.write(x)
lcm = lambda x, y: x * y // gcd(x, y)
hg = lambda x, y: (y + x - 1) // x * x
pw = lambda x: 1 if x == 1 else 1 + pw(x // 2)
chk = lambda x: chk(x // 2) if not x % 2 else True if x == 1 else False
sm = lambda x: (x ** 2 + x) // 2
N = 10 ** 9 + 7
for _ in range(I()):
	print(max(R()))


for _ in range(int(input())):
	val = list(map(int, input().split(' ')))
	val.sort()
	print(val[2] + val[1] - val[0])


import random
for t in range(int(input())):
	(a, b, c) = map(int, input().split())
	s = a + b + c
	largest = max(max(a, b), c)
	diff = s - largest
	diff1 = largest - diff
	if diff1 <= 0:
		print(random.randint(1, s - 1))
	else:
		print(random.randint(diff1 + 1, s - 1))


for something in range(int(input())):
	a = list(map(int, input().split()))
	print(max(a))


import math
from decimal import *
import random
mod = int(1000000000.0) + 7
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	ans = math.ceil(math.sqrt(b ** 2 + abs(c - a) ** 2))
	print(ans)


import sys

def main():
	T = int(input())
	for ti in range(T):
		s = sum((int(v) for v in input().split()))
		print(s - 1)
main()


t = int(input())
for you in range(t):
	l = input().split()
	li = [int(i) for i in l]
	print(max(li) + 1)


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


t = int(input())
for _ in range(t):
	print(sum(map(int, input().split())) - 1)


t = int(input())
for i in range(t):
	(a, b, c) = map(int, input().split())
	m = max(a, b, c)
	s = a + b + c
	if m < s - m:
		print(1)
	else:
		print(m - (s - m) + 1)


T = int(input())
for i in range(T):
	ai = list(map(int, input().split(' ')))
	print(ai[0] + ai[1] + ai[2] - 1)


import sys
from sys import stdin, stdout
import math
import random
import heapq
from collections import Counter
from functools import lru_cache
try:
	for _ in range(int(input())):
		(a, b, c) = map(int, input().split())
		print(max(a, b, c) + 1)
except EOFError as e:
	print(e)


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


for _ in range(int(input())):
	print(max(map(int, input().split())))


import sys, math
import io, os
from bisect import bisect_left as bl, bisect_right as br, insort
from heapq import heapify, heappush, heappop
from collections import defaultdict as dd, deque, Counter

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

def mdata():
	return list(map(int, data().split()))

def outl(var):
	sys.stdout.write('\n'.join(map(str, var)) + '\n')

def out(var):
	sys.stdout.write(str(var) + '\n')
INF = float('inf')
mod = 10 ** 9 + 7
for t in range(int(data())):
	out(sum(mdata()) - 1)


for _ in range(int(input())):
	arr = [int(a) for a in input().split(' ')]
	ans = sum(arr) - 1
	print(ans)


for _ in range(int(input())):
	a = [*map(int, input().split())]
	a.sort()
	print(a[2] - a[0] + 1)


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


rn = lambda : int(input())
rns = lambda : map(int, input().split())
rl = lambda : list(map(int, input().split()))
rs = lambda : input()
yn = lambda x: print('Yes') if x else print('No')
for _ in range(rn()):
	(a, b, c) = rns()
	import math
	ans = (b ** 2 + (a - c) ** 2) ** 0.5
	ans = math.ceil(ans)
	print(ans)


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


for _ in range(int(input())):
	arr = list(map(int, input().split()))
	print(max(arr))


from math import sqrt
for cnt in range(int(input())):
	(a, b, c) = map(int, input().split())
	l = [a, b, c]
	l.sort()
	print(int(sqrt(l[0] * l[0] + (l[2] - l[1]) * (l[2] - l[1]))) + 1)


import sys
tests = int(sys.stdin.readline())
while tests > 0:
	line = sys.stdin.readline()
	line = line.split(' ')
	a = int(line[0])
	b = int(line[1])
	c = int(line[2])
	d = a + b + c - 1
	tests -= 1
	print(d)


t = int(input())
for i in range(t):
	n = [int(j) for j in input().split()]
	a = n[0]
	b = n[1]
	c = n[2]
	dia = a + b - 1
	d = c + dia - 1
	print(d)


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


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


for _ in ' ' * int(input()):
	(a, b, c) = map(int, input().split())
	x = max(a, b, c)
	n = min(a, b, c)
	print(x + n)


t = int(input())
for i in range(t):
	a = sum(list(map(int, input().split()))) - 1
	print(a)


t = int(input())
for _ in range(t):
	(a, b, c) = [int(x) for x in input().split()]
	print(a + b + c - 2)


t = int(input())
for i in range(t):
	(a, b, c) = [int(i) for i in input().split()]
	a1 = max(a, b, c)
	c1 = min(a, b, c)
	b1 = a + b + c - a1 - c1
	print(a1 + b1 - c1)


import os
import sys
import io
import functools
import copy
import math
GANS = []

def cmp(x, y):
	if x[1] == y[1]:
		return -(y[0] - x[0])
	return -(x[1] - y[1])
t = int(input())
for _ in range(t):
	(n, m, s) = map(int, input().split())
	l = [n, m, s]
	l.sort()
	print(l[2])


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log2, ceil, pi, sin, cos, acos, atan
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
from bisect import insort
from collections import Counter
from collections import deque
from heapq import heappush, heappop, heapify
from itertools import permutations, combinations
mod = int(1000000000.0) + 7
ip = lambda : int(stdin.readline())
inp = lambda : map(int, stdin.readline().split())
ips = lambda : stdin.readline().rstrip()
out = lambda x: stdout.write(str(x) + '\n')
t = ip()
for _ in range(t):
	(a, b, c) = inp()
	arr = [a, b, c]
	arr.sort()
	ans = arr[1] + arr[2] - arr[0]
	ans += 1
	out(ans)


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


import sys
input = sys.stdin.readline
(inp, ip) = (lambda : int(input()), lambda : [int(w) for w in input().split()])
for _ in range(inp()):
	x = ip()
	x.sort()
	print(max(x))


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	min_num1 = abs(abs(a - b) - c)
	min_num2 = abs(abs(a - c) - b)
	min_num3 = abs(abs(c - b) - a)
	max_num = abs(a + b + c)
	r = max(min_num1, min_num2, min_num3)
	print(r + 1)


import sys
t = int(input())
for tc in range(t):
	lst = list(map(int, input().split()))
	lst.sort()
	print(lst[2] + 1)


import math
for t in range(int(input())):
	arr = list(map(int, input().split()))
	arr.sort()
	print(arr[2])


t = int(input())
for _ in range(t):
	(a, b, c) = [int(x) for x in input().split()]
	m = max(a, b, c)
	print(m + 1)


for t in range(int(input())):
	(a, b, c) = map(int, input().split())
	x = max(a, max(b, c))
	print(x)


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


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


import math
T = int(input())
while T:
	T -= 1
	(x, y, z) = map(int, input().split())
	x = max(max(x, y), z)
	print(x)


t = int(input())
for i in range(t):
	arr = [int(x) for x in input().split()]
	print(arr[0] + arr[1] + arr[2] - 1)


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


def test():
	num = list(map(int, input().split()))
	n = sum(num) - 1
	print(n)
t = int(input())
for i in range(t):
	test()


from sys import stdin, stdout
import math, sys, heapq
from itertools import permutations, combinations
from collections import defaultdict, deque, OrderedDict
from os import path
import random
import bisect as bi

def yes():
	print('YES')

def no():
	print('NO')
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

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

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

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

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

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())
		l.sort()
		t = l[2] - l[0]
		temp = (t ** 2 + l[1] ** 2) ** 0.5
		print(math.ceil(temp))
	except:
		pass
M = 998244353
P = 1000000007
for _ in range(I()):
	main()


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


t = int(input())
l = []
for count in range(0, t):
	(x, y, z) = map(int, input().split(' '))
	l.append(x + y + z - 1)
for count in range(0, t):
	print(l[count])


import math
for i in range(int(input())):
	(n, m, x) = map(int, input().split())
	print(max(n, m, x))


t = int(input())
for i in range(t):
	(a, b, c) = map(int, input().split())
	print(a + b + c - 2 * min([a, b, c]))


import sys
import math
input = lambda : sys.stdin.readline().rstrip()
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	print(math.ceil(math.sqrt(a ** 2 + (b - c) ** 2)))


from math import sqrt
t = int(input())
for i in range(t):
	(a, b, c) = map(int, input().split())
	p = sqrt(a * a + (b + c) * (b + c))
	print(int(p))


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


from math import floor, sqrt
t = int(input())
for _ in range(t):
	val_list = list(map(int, input().strip().split()))
	val_list = sorted(val_list)
	ans = floor(sqrt(pow(val_list[2], 2) + pow(val_list[1] - val_list[0], 2)))
	print(ans)


for _ in range(int(input())):
	l = [int(e) for e in input().split()]
	l.sort()
	x = ((l[0] + l[1]) ** 2 + l[2] ** 2) ** 0.5
	x = x // 1
	print(int(x))


t = int(input())
for q in range(t):
	(a, b, c) = map(int, input().split())
	ar = [a, b, c]
	ar.sort()
	print(ar[2] + 1)


t = int(input())
sides = list()
for j in range(t):
	sides.append(list(map(int, input().split())))
for j in range(t):
	print(sum(sides[j]) - 2)


[print(sum((int(__) for __ in input().split())) - 1) for _ in range(int(input()))]


import sys
import math
input = sys.stdin.readline

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

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

def insr():
	s = input()
	s = list(s[:len(s)])
	if s[-1] == '\n':
		del s[-1]
	return s

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

def f(x):
	sumS = sum(x)
	return sumS - 1
t = inp()
result = []
for i in range(t):
	x = inlt()
	result.append(f(x))
for i in range(t):
	print(result[i])


t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	(x1, x2) = (b, c)
	(y1, y2) = (0, a)
	d = ((x2 - x1) ** 2 + (y2 - y1) ** 2) ** 0.5
	print(int(d) + 1)


n = int(input())
for j in range(0, n):
	x = list(map(int, input().split()))
	print(max(x))


t = int(input())
p = []
q = []
for i in range(t):
	q = list(map(int, input().split()))
	p.append(q)
for i in range(t):
	e = min(p[i][0], p[i][1], p[i][2])
	print(p[i][0] + p[i][1] + p[i][2] - 2 * e)


from sys import stdin, stdout
import math, sys
from itertools import permutations, combinations
from collections import defaultdict, deque, OrderedDict, Counter
from os import path
import bisect as bi
import heapq
mod = 10 ** 9 + 7

def yes():
	print('YES')

def no():
	print('NO')
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

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

	def minp():
		return map(int, input().split())
else:

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

	def minp():
		return map(int, stdin.readline().split())
for _ in range(inp()):
	(a, b, c) = minp()
	print(a + b + c - 1)


import random
for i in range(int(input())):
	(a, b, c) = map(int, input().split())
	x = random.randint(abs(a - b) + 1, a + b - 1)
	d = random.randint(abs(x - c) + 1, x + c - 1)
	print(d, end='\n')


import math
t = int(input())
while t:
	(a, b, c) = [int(x) for x in input().split()]
	sol = math.sqrt((c - a) * (c - a) + b * b)
	print(math.ceil(sol))
	t = t - 1


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


ncases = int(input())

def to_int(s):
	return int(s)
for case in range(ncases):
	sides = list(map(to_int, input().split(' ')))
	print(sides[0] + sides[1] + sides[2] - 1)


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


t = int(input())
for _ in range(t):
	(x, y, z) = map(int, input().split())
	print(x + y + z - min(x, y, z))


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


import math
t = int(input())
while t > 0:
	t -= 1
	a = list(map(int, input().split()))
	a.sort()
	d = math.sqrt((a[0] - a[2]) ** 2 + a[1] ** 2)
	d = math.ceil(d)
	print(d, '\n')


import sys
input = sys.stdin.readline

def print(val):
	sys.stdout.write(str(val) + '\n')

def prog():
	for _ in range(int(input())):
		a = list(map(int, input().split()))
		print(sum(a) - 1)
prog()


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


from math import sqrt, ceil
for _ in range(int(input())):
	ls = sorted(list(map(int, input().split())))
	ls[2] -= ls[0]
	print(ceil(sqrt(ls[1] ** 2 + ls[2] ** 2)))


import math
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	x = []
	x.append(a)
	x.append(b)
	x.append(c)
	x.sort()
	if x[2] != 10 ** 9:
		print(x[2] + 1)
	elif x[2] - x[1] != 1:
		print(x[2] - 1)
	elif x[1] - x[0] != 1:
		print(x[1] - 1)
	else:
		print(x[0] - 1)


n = int(input())
for i in range(n):
	x = [int(v) for v in input().split()]
	x.sort()
	print(x[-1] + 1)


t = int(input())
for k in range(t):
	(a, b, c) = list(map(int, input().split()))
	min1 = abs(a - b - c)
	max1 = a + b + c
	if min1 != max1:
		print(min1 + 1)
	else:
		print(min1)


import sys
input = sys.stdin.readline

def main():
	abc = list(map(int, input().split()))
	print(max(abc))
for _ in range(int(input())):
	main()


from math import ceil
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	d = (b ** 2 + (c - a) ** 2) ** 0.5
	print(ceil(d))


t = int(input())
result = []
for _ in range(t):
	lst = [int(x) for x in input().split()]
	lst.sort()
	result.append(lst[1] + lst[2] - lst[0])
print(*[result[i] for i in range(t)], sep='\n')


t = int(input())
while t:
	t -= 1
	(a, b, c) = list(map(int, input().split()))
	print(max(a + b, b + c, c + a))


t = int(input())
while t:
	t -= 1
	(s1, s2, s3) = map(int, input().split())
	c1 = max(s1, s3) - min(s1, s3)
	print(int((c1 ** 2 + s2 ** 2) ** (1 / 2)))


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


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


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

def ii():
	return int(input())

def fi():
	return float(input())

def si():
	return input()

def msi():
	return map(str, input().split())

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

def li():
	return list(mi())

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

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def lcm(x, y):
	return x * y // gcd(x, y)
mod = 1000000007

def modInverse(b, m):
	g = gcd(b, m)
	if g != 1:
		return -1
	else:
		return pow(b, m - 2, m)

def ceil(x, y):
	if x % y == 0:
		return x // y
	else:
		return x // y + 1

def modu(a, b, m):
	a = a % m
	inv = modInverse(b, m)
	if inv == -1:
		return -999999999
	else:
		return inv * a % m
from math import log, sqrt, factorial, cos, tan, sin, radians, floor
import bisect
from decimal import *
getcontext().prec = 8
abc = 'abcdefghijklmnopqrstuvwxyz'
pi = 3.141592653589793

def fn(n):
	c = 0
	while n % 2 == 0:
		c += 1
		n //= 2
	return c

def main():
	for _ in range(ii()):
		l = li()
		l.sort()
		if l[0] == l[1]:
			print(l[2])
		elif l[1] == l[2]:
			print(l[0])
		else:
			print(l[2])
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')
main()


import random
t = int(input())
for i in range(t):
	(a, b, c) = [int(i) for i in input().split()]
	print(a + b + c - 1)


import sys
input = sys.stdin.buffer.readline

def solution():
	l = list(map(int, input().split()))
	print(max(l) + 1)
t = int(input())
for _ in range(t):
	solution()


import math
import sys
import re
n = int(input())
for x in range(n):
	a = list(map(int, input().rstrip().split()))
	print(sum(a) - 1)


def solve(a, b, c):
	return max(a, b, c)
t = int(input())
for i in range(t):
	(a, b, c) = tuple((int(i) for i in input().split()))
	print(solve(a, b, c))


import sys

def is_possible(arr):
	lst = []
	item = -1
	Min = abs(arr[2] - arr[1] - arr[0])
	Max = arr[0] + arr[1] + arr[2]
	for i in range(Min + 1, Max):
		if i != arr[0] and i != arr[1] and (i != arr[2]):
			item = i
			break
	return item
n = int(sys.stdin.readline().strip())
for i in range(n):
	arr = [int(x) for x in sys.stdin.readline().split()]
	print(is_possible(arr))


t = int(input(''))
for _ in range(t):
	(a, b, c) = map(int, input('').strip().split(' '))
	print(a + b + c - 2)


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


t = int(input())
while t:
	a = list(map(int, input().split()))
	print(sum(a) - 1)
	t = t - 1


for t in range(int(input())):
	(a, b, c) = map(int, input().split())
	tn = a + b + c - 2
	print(tn)


t = int(input())
for i in range(t):
	print(sum([int(x) for x in input().split()]) - 1)


t = int(input())
while t:
	t -= 1
	(a, b, c) = map(int, input().split())
	print(a + b + c - 1)


def tran(arr):
	p = max(arr)
	return p
t = int(input())
ans = []
for i in range(t):
	arr = list(map(int, input().rstrip().split()))
	r = tran(arr)
	ans.append(r)
for i in ans:
	print(i)


for i in range(int(input())):
	print(max(list(map(int, input().split()))))


T = int(input())
for t in range(T):
	(a, b, c) = [int(_) for _ in input().split()]
	print(max(a, b, c))


import sys
from collections import defaultdict
input = sys.stdin.readline
from math import sqrt, ceil
for _ in range(int(input())):
	lis = list(map(int, input().split()))
	lis.sort()
	print(ceil(sqrt(lis[0] ** 2 + (lis[2] - lis[1]) ** 2)))


t = int(input())
from math import sqrt, ceil

def solve(a, b, c):
	d = sqrt(b ** 2 + abs(c - a) ** 2)
	return ceil(d)
for i in range(t):
	(a, b, c) = [int(x) for x in input().strip().split(' ')]
	print(solve(a, b, c))


m = int(input())
for i in range(m):
	(a, b, c) = input().split()
	print(max(int(a), int(b), int(c)))


for test in range(int(input())):
	[a, b, c] = list(map(int, input().split(' ')))
	print(max(a, b, c))


import sys
import heapq, functools, collections
import math, random
from collections import Counter, defaultdict

def solve(a, b, c):
	console('----- solving ------')
	return max([a, b, c])

def console(*args):
	print('\x1b[36m', *args, '\x1b[0m', file=sys.stderr)
	return
for case_num in range(int(input())):
	(a, b, c) = list(map(int, input().split()))
	res = solve(a, b, c)
	print(res)


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


t = int(input())
from math import ceil
while t:
	a = map(int, input().split())
	a = list(a)
	a = sorted(a)
	print(ceil((a[0] ** 2 + (a[2] - a[1]) ** 2) ** 0.5))
	t -= 1


from sys import stdin
from math import sqrt, ceil
input = lambda : stdin.readline().rstrip()
N = int(input())
for _ in range(N):
	l = sorted(map(int, input().split()))
	print(int(ceil(sqrt((l[2] - l[1]) ** 2 + l[0] ** 2))))


t = int(input())
for I in range(t):
	a = [int(i) for i in input().split()]
	print(max(a))


import os
import math
true = True
false = False
from functools import reduce
is_dev = 'vscode' in os.environ
if is_dev:
	inF = open('in.txt', 'r')
	outF = open('out.txt', 'w')

def ins():
	return list(map(int, input_().split(' ')))

def inss():
	return list(input_().split(' '))

def input_():
	if is_dev:
		return inF.readline()[:-1]
	else:
		return input()

def ranin():
	return range(int(input_()))

def print_(data):
	if is_dev:
		outF.write(str(data) + '\n')
	else:
		print(data)
epsilon = 1e-07
for _ in ranin():
	(a, b, c) = ins()
	if c + 2 * b > a and a + 2 * b > c:
		print_(b)
	elif c + 2 * b <= a:
		print_(a + 1)
	else:
		print_(c + 1)
if is_dev:
	outF.close()

	def compare_file():
		print(open('out.txt', 'r').read() == open('outactual.txt', 'r').read())
	compare_file()


(n, *a) = map(int, open(0).read().split())
for i in range(n):
	print(max(a[i * 3:-~i * 3]))


def main():
	(a, b, c) = list(map(int, input().split()))
	print(max({a, b, c}) + 1)
t = int(input())
while t != 0:
	main()
	t -= 1


import sys, os, io

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

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

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

def ws(s):
	sys.stdout.write(s + '\n')

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

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math, datetime, functools, itertools, operator, bisect, fractions
from collections import deque, defaultdict, OrderedDict, Counter
from fractions import Fraction
from decimal import Decimal
from sys import stdout

def main():
	starttime = datetime.datetime.now()
	if os.path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	for _ in range(ri()):
		a = ria()
		print(sum(a) - 1)
	endtime = datetime.datetime.now()
	time = (endtime - starttime).total_seconds() * 1000
	if os.path.exists('input.txt'):
		print('Time:', time, 'ms')

class FastReader(io.IOBase):
	newlines = 0

	def __init__(self, fd, chunk_size=1024 * 8):
		self._fd = fd
		self._chunk_size = chunk_size
		self.buffer = io.BytesIO()

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size))
			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, size=-1):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size if size == -1 else size))
			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()

class FastWriter(io.IOBase):

	def __init__(self, fd):
		self._fd = fd
		self.buffer = io.BytesIO()
		self.write = self.buffer.write

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

class FastStdin(io.IOBase):

	def __init__(self, fd=0):
		self.buffer = FastReader(fd)
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

class FastStdout(io.IOBase):

	def __init__(self, fd=1):
		self.buffer = FastWriter(fd)
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.flush = self.buffer.flush
sys.stdin = FastStdin()
sys.stdout = FastStdout()
main()


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	l = [a, b, c]
	l.sort()
	s1 = b
	s2 = c - a
	s3 = int((s2 ** 2 + s1 ** 2) ** 0.5)
	print(s3)


import math
from collections import deque
from sys import stdin, stdout
from string import ascii_letters
letters = ascii_letters[:26]
from collections import defaultdict
input = stdin.readline
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	print(a + b + c - 1)


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


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


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush, nsmallest
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
from decimal import Decimal
mod = pow(10, 9) + 7
mod2 = 998244353

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

def out(var, end='\n'):
	sys.stdout.write(str(var) + end)

def outa(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
for _ in range(int(data())):
	(a, b, c) = sp()
	print(a + b + c - 2)


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


import os
import sys
from io import BytesIO, IOBase

def solution():
	(a, b, c) = map(int, input().split())
	print(a + b + c - 1)
	return

def main():
	testcases = 1
	testcases = int(input())
	for _ in range(testcases):
		solution()
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')
main()


ans = []
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	ans.append(max(a, b, c))
print('\n'.join(map(str, ans)))


def cond(a, b, c, d):
	return a + b + c > d and b + c + d > a and (c + d + a > b) and (d + a + b > c)

def solve(a, b, c):
	upBound = a + b + c
	lowBound = max(a - b - c, b - a - c)
	lowBound = max(lowBound, c - a - b)
	lowBound = max(lowBound, 1)
	i = lowBound
	while not cond(a, b, c, i):
		i += 1
	return i
t = int(input())
for t0 in range(t):
	(a, b, c) = list(map(int, input().split()))
	print(solve(a, b, c))


t = int(input())
for w in range(t):
	(a, b, c) = list(map(int, input().split()))
	print(max(a, b, c))


t = int(input())
for i in range(t):
	(a, b, c) = list(map(int, input().split()))
	r = max(a, b, c)
	r2 = min(a, b, c)
	print(r + r2)


from math import sqrt
inp = lambda : int(input())
seq = lambda : list(map(int, input().strip().split()))

def results(abc):
	abc.sort()
	(a, b, c) = (abc[0], abc[1], abc[2])
	d = a ** 2
	d += (b - c) ** 2
	return sqrt(d)

def main():
	t = inp()
	for _ in range(t):
		abc = seq()
		print(int(results(abc)) + 1)
main()


import math
test = int(input())
for i in range(test):
	(a, b, c) = [int(x) for x in input().split(' ')]
	temp = pow(a, 2) + abs(pow(b, 2) - pow(c, 2))
	ans = math.ceil(math.sqrt(temp))
	print(ans)


for _ in range(int(input())):
	(x, y, k) = map(int, input().split())
	print(x + y + k - 1)


import os
import sys
import math
import collections

def get_int():
	return int(input())

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

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

def get_float():
	return float(input())

def get_floats():
	return map(float, input().split())

def list_strs():
	return list(input().split())

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

def list_floats():
	return list(map(float, input.split()))

def post(x):
	print(x, end=' ')
T = int(input())
for t in range(1, T + 1):
	(a, b, c) = get_ints()
	d = a + b + c - 1
	print(d)


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())
T = inp()
for _ in range(T):
	data = inlt()
	sys.stdout.write(str(sum(data) - 1) + '\n')


from math import ceil, sqrt
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	x = max(a, b, c)
	l = [a, b, c]
	l.remove(x)
	y = max(l) - min(l)
	print(ceil(sqrt(x ** 2 + y ** 2)))


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import ceil, floor
from copy import *
from collections import deque, defaultdict
from collections import Counter as counter
from itertools import combinations
from itertools import permutations as permutate
from bisect import bisect_left as bl
from operator import *
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192
from sys import stderr

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))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

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 nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def pow(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res
from functools import reduce

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

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

def prefix_sum(ar):
	return list(accumulate(ar))

def suffix_sum(ar):
	return list(accumulate(ar[::-1]))[::-1]
from collections import defaultdict

def numberOfSetBits(i):
	i = i - (i >> 1 & 1431655765)
	i = (i & 858993459) + (i >> 2 & 858993459)
	return ((i + (i >> 4) & 252645135) * 16843009 & 4294967295) >> 24

def solve():
	(a, b, c) = sep()
	print(max(a, b, c))
testcase(int(inp()))


tt = int(input())
while tt:
	tt -= 1
	import math
	l = list(map(int, input().split()))
	ll = sorted(l, reverse=True)
	print(ll[0])


import math
for i in range(int(input())):
	(a, b, c) = map(int, input().split())
	n = max(a, b, c)
	m = min(a, b, c)
	mid = a + b + c - (m + n)
	print(math.floor(math.sqrt((n - m) * (n - m) + mid * mid)))


import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase

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

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ALPHA = 'abcdefghijklmnopqrstuvwxyz/'
M = 998244353
EPS = 1e-06

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

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

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

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
for _ in range(Int()):
	(a, b, c) = sorted(value())
	print(c)


import sys

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

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

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

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))
mod = int(1000000000.0) + 7
for _ in range(iinput()):
	(a, b, c) = rinput()
	d = a + b + c - 1
	if a + b + d < c:
		d -= c - (a + b + d)
	if a + c + d < b:
		d -= b - (a + c + d)
	if b + c + d < a:
		d -= a - (b + c + d)
	print(d)


import math
n = int(input())
while n:
	n -= 1
	y = [int(i) for i in input().split()]
	a = y[0]
	b = y[1]
	c = y[2]
	print(math.ceil(math.sqrt(a ** 2 + (b - c) ** 2)))


def main():
	w = input()
	w = int(w)
	result = []
	for _ in range(w):
		(a, b, c) = input().split()
		a = int(a)
		b = int(b)
		c = int(c)
		result.append(round(max(a, b, c)))
	for i in result:
		print(i)
main()


import sys

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

def list2d(a, b, c):
	return [[c for j in range(b)] for i in range(a)]

def list3d(a, b, c, d):
	return [[[d for k in range(c)] for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e for l in range(d)] for k in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

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

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

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 19
MOD = 10 ** 9 + 7
EPS = 10 ** (-10)
for _ in range(INT()):
	li = LIST()
	ans = sum(li) - 1
	print(ans)


for t in range(int(input())):
	(a, b, c) = sorted(map(int, input().split()))
	print(int(((c - a) ** 2 + b ** 2) ** 0.5))


import math
t = input()
t = int(t)
for i in range(t):
	arr = list(map(int, input().rstrip().split()))
	arr.sort()
	a = arr[2] - arr[1]
	c = a * a + arr[0] * arr[0]
	x = math.sqrt(c)
	x = int(x) + 1
	print(x)


def solve():
	(a, b, c) = map(int, input().split())
	print(a + b + c - 2)
	return

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


x = int(input())
for i in range(0, x):
	m = list(map(int, input().split()))[:3]
	d = sum(m) - 1
	print(d)


for _ in range(int(input())):
	a = list(map(int, input().split()))
	print(sum(a) - 1)


from collections import Counter
import string
import math
import sys

def array_int():
	return [int(i) for i in sys.stdin.readline().split()]

def vary(arrber_of_variables):
	if arrber_of_variables == 1:
		return int(sys.stdin.readline())
	if arrber_of_variables >= 2:
		return map(int, sys.stdin.readline().split())

def makedict(var):
	return dict(Counter(var))
mod = 1000000007
for _ in range(vary(1)):
	(a, b, c) = vary(3)
	print(max(a, b, c))


n = int(input())
while n > 0:
	l = list(map(int, input().split()))
	print(sum(l) - 1)
	n -= 1


import math
t = int(input())
d = float()
for i in range(t):
	(a, b, c) = map(int, input().split())
	d = math.sqrt(b * b + (c - a) * (c - a))
	print(math.ceil(d))


import math
n = int(input())
for u in range(n):
	(a, b, c) = map(int, input().split())
	print(math.ceil((a ** 2 + abs(b - c) ** 2) ** 0.5))


for _ in range(int(input())):
	sides = list(map(int, input().split()))
	sides.sort()
	result = sides[2] + 1
	print(result)


for t in range(int(input())):
	a = list(map(int, input().split(' ')))
	a.sort()
	d = a[2] - a[0] + a[1]
	print(d)


t = int(input())
while t > 0:
	t -= 1
	lst = list(map(int, input().split()))
	print(max(lst) + 1)


from math import ceil, sqrt
from collections import defaultdict

def solve():
	(a, b, c) = map(int, input().split())
	z = abs(c - b) ** 2 + a ** 2
	z = sqrt(z)
	print(ceil(z))
t = int(input())
for _ in range(t):
	solve()


T = int(input())
for _ in range(0, T):
	(a, b, c) = map(int, input().split())
	diff = abs(a - c)
	ans = int((diff ** 2 + b ** 2) ** 0.5)
	print(ans)


from sys import *
n = int(stdin.readline())
for i in range(n):
	nums = [int(x) for x in stdin.readline().split()]
	nums.sort()
	tmp = nums[-1] + nums[-2]
	hue = tmp - nums[0]
	print(hue)


t = int(input())
for q in range(t):
	ch = input()
	L = [int(i) for i in ch.split()]
	(a, b, c) = (L[0], L[1], L[2])
	print(a + b + c - 1)


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


for _ in range(int(input())):
	l = list(map(int, input().split()))
	l.sort()
	dd = l[1] - l[0]
	d = max(l)
	print(d + dd)


for _ in range(int(input())):
	(a, b, c) = [int(x) for x in input().split()]
	print(max(max(a, b), c))


t = int(input())
i = 0
while i < t:
	a = list(map(int, input().split()))
	a.sort()
	print(a[2] + a[1] - a[0])
	i += 1


import math

def solve():
	(a, b, c) = map(int, input().split())
	d = math.ceil(math.sqrt((a - c) ** 2 + b ** 2))
	print(d)
	return

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


from math import sqrt
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	print(int(sqrt((c - b) ** 2 + a ** 2)))


def solve():
	(a, b, c) = sorted([int(x) for x in input().strip().split()])
	if a + b >= c:
		return 1
	return 1 + c - a - b
for _ in range(int(input().strip())):
	print(solve())


import math
t = int(input())
i = 0
while i < t:
	a = list(map(int, input().split()))
	a.sort
	A = a[0]
	B = a[1]
	C = a[2]
	Ans = ((A - C) * (A - C) + B * B) ** (1 / 2)
	Ans = math.ceil(Ans)
	print(Ans)
	i += 1


t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	a = [a, b, c]
	a.sort()
	k = a[2] - a[0] - a[1]
	if k > 0:
		print(k + 1)
	else:
		print(1)


def main():
	inp = int(input())
	for i in range(inp):
		(a, b, c) = input().split()
		a = int(a)
		b = int(b)
		c = int(c)
		print(a + b + c - 2)
main()


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


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


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__
t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	print(a + b + c - 1)


import math
t = int(input())
while t:
	s = input().split()
	a = [int(i) for i in s]
	a.sort()
	h = math.sqrt(a[1] * a[1] + a[2] * a[2])
	y = math.ceil(h + a[0]) - 1
	print(y)
	t -= 1


import math
t = int(input())
for _ in range(t):
	a = list(map(int, input().split()))
	print(max(a))


t = int(input())
while t > 0:
	(a, b, c) = map(int, input().split())
	d = int((b ** 2 + (c - a) ** 2) ** (1 / 2))
	print(d)
	t -= 1


n = int(input())
for _ in range(0, n):
	fences = list(map(int, input().strip().split()))
	sum = fences[0] + fences[1] + fences[2]
	print(sum - 2)


import math
for i in range(int(input())):
	(a, b, c) = map(int, input().split())
	print(math.ceil((a ** 2 + b ** 2 + c ** 2) ** 0.5))


t = int(input())

def solve():
	abc = list(map(int, input().split()))
	print(sum(abc) - 1)
for i in range(t):
	solve()


t = int(input())
for _ in range(t):
	(a, b, c) = sorted(list(map(int, input().split())))
	print(a + c)


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__

def gift():
	for _ in range(t):
		(a, b, c) = list(map(int, input().split()))
		yield (a + b + c - 1)

def __starting_point():
	t = int(input())
	ans = gift()
	print(*ans, sep='\n')
__starting_point()


import math
t = int(input())
for _ in range(t):
	inp = [int(i) for i in input().split()]
	print(inp[0] + inp[1] + inp[2] - 1)


t = int(input())
x = []
for i in range(t):
	s = input().split(' ')
	for j in range(len(s)):
		s[j] = int(s[j])
	d = sum(s) - 1
	x.append(d)
for k in range(t):
	print(x[k])


for tt in range(int(input())):
	print(sum(list(map(int, input().split()))) - 1)


import io, os
R = lambda : map(int, input().split())
for _ in range(int(input())):
	a = list(R())
	a.sort()
	print(a[2])


testcases = int(input())
for i in range(testcases):
	a = list(map(int, input().split()))
	a.sort()
	print(a[0] + a[2])


for x in range(int(input())):
	(a, b, c) = map(int, input().split())
	e = abs(b - c)
	ans = a + e
	print(ans)


t = int(input())
while t:
	a = list(map(int, input().split()))
	a = sorted(a)
	print(a[2] + a[1] - a[0])
	t -= 1


from math import floor, sqrt
t = int(input())
while t:
	t -= 1
	arr = [int(x) for x in input().split()]
	arr.sort()
	print(floor(sqrt(arr[1] ** 2 + (arr[2] - arr[0]) ** 2)))


from math import pow
from math import sqrt
t = int(input())
i = 0
while i < t:
	(a, b, c) = map(int, input().split())
	x = sqrt(pow(c - b, 2) + pow(a, 2))
	print(int(x) + 1)
	i += 1


from sys import stdin, stdout
import math
from collections import deque
input = stdin.readline

def print(*args, end='\n'):
	s = []
	for i in args:
		s.append(str(i) + ' ')
	s = ''.join(s)
	stdout.write(s + end)

def solve():
	l = list(map(int, input().split()))
	l.sort()
	(x, y, z) = l
	print(math.ceil(pow((y - x) ** 2 + z ** 2, 0.5)))
tt = 1
tt = int(input())
for __ in range(tt):
	solve()


import math
for _ in range(int(input())):
	arr = list(map(int, input().split()))
	arr.sort()
	(a, b, c) = (arr[0], arr[1], arr[2])
	z = c - a
	d = math.ceil((z ** 2 + b ** 2) ** 0.5)
	print(int(d))


for _ in range(int(input())):
	a = sorted(map(int, input().split()))
	print(max(a) + 1)


i = int(input())
for q in range(i):
	sides = input().split()
	for j in range(len(sides)):
		sides[j] = int(sides[j])
	min = abs(sides[0] - sides[1])
	diag = min + 1
	print(sides[2] + diag - 1)


def main():
	(a, b, c) = map(int, input().split())
	print(max(a, b, c))
____case = 0
while True:
	try:
		____case += 1
		case = 1
		case = int(input())
		for __ in range(case):
			main()
		input()
		print()
	except:
		break


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


from sys import *
from math import *
t = int(stdin.readline())
for _ in range(t):
	a = list(map(int, stdin.readline().split()))
	a.sort()
	h = a[2] - a[1]
	x = int(sqrt(abs(h * h + a[0] * a[0])))
	print(x)


from math import ceil
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	print(ceil(((a - b) ** 2 + c ** 2) ** (1 / 2)))


import math
t = int(input())
for _ in range(t):
	l = list(map(int, input().split()))
	l.sort()
	d = math.ceil(math.sqrt((l[2] - l[1]) ** 2 + l[0] ** 2))
	print(d)


from sys import stdout, stdin
from io import IOBase, BytesIO
from os import read, write, fstat
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 = read(self._fd, max(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, size: int=...):
		while self.newlines == 0:
			b = read(self._fd, max(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:
			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', 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()
(stdin, stdout) = (IOWrapper(stdin), IOWrapper(stdout))
input = lambda : stdin.readline().rstrip('\r\n')
t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	print(max(a, b, c) + 1)


t = int(input())
for j in range(t):
	l = list(map(int, input().strip().split()))
	res = max(l)
	res1 = sum(l) - 1
	l.append(res)
	if max(l) < sum(l) / 2:
		print(res)
	else:
		print(res1)


t = int(input())
for i in range(t):
	(a, b, c) = input().split()
	(a, b, c) = (int(a), int(b), int(c))
	if c > a:
		ca = c - a
	elif c < a:
		ca = a - c
	else:
		ca = 0
	d = (ca ** 2 + b ** 2) ** (1 / 2)
	if type(d) == int:
		print(d)
	else:
		print(int(d) + 1)


import math
for t in range(int(input())):
	nums = list(map(int, input().split()))
	x = max(nums[2], nums[0])
	y = nums[1]
	output = math.sqrt(x ** 2 + y ** 2)
	print(round(output))


import sys
read = lambda : sys.stdin.readline().strip()
readi = lambda : map(int, read().split())
from collections import *
for _ in range(int(read())):
	(a, b, c) = readi()
	print(max(1, a - b - c + 1, b - a - c + 1, c - a - b + 1))


import sys
try:
	(sys.stdin, sys.stdout) = (open('in.txt', 'r'), open('out.txt', 'w'))
except:
	pass
ii1 = lambda : int(sys.stdin.readline().strip())
is1 = lambda : sys.stdin.readline().strip()
iia = lambda : list(map(int, sys.stdin.readline().strip().split()))
isa = lambda : sys.stdin.readline().strip().split()
mod = int(1000000000.0 + 7)
from collections import *
from math import *
for _ in range(ii1()):
	arr = iia()
	arr.sort()
	sm = arr[1] + arr[2]
	print(sm - arr[0])


import math
t = int(input())
for i in range(t):
	(a, b, c) = map(int, input().split())
	m1 = max(a, b, c)
	mi = min(a, b, c)
	if a == m1:
		m2 = max(b, c)
		di = math.sqrt(m1 ** 2 + m2 ** 2)
	elif b == m1:
		m2 = max(a, c)
		di = math.sqrt(m1 ** 2 + m2 ** 2)
	else:
		m2 = max(a, b)
		di = math.sqrt(m1 ** 2 + m2 ** 2)
	print(math.ceil(math.sqrt(di ** 2 - mi ** 2)))


from math import sqrt
for _ in range(int(input())):
	lis = list(map(int, input().split()))
	lis.sort()
	v1 = int(sqrt(lis[2] * lis[2] + (lis[1] - lis[0]) * (lis[1] - lis[0]))) + 1
	print(v1)


import math
t = int(input())
for _ in range(t):
	(a, b, c) = [int(x) for x in input().split(' ')]
	print(int(math.sqrt((a + b) ** 2 + c ** 2)))


def kek():
	(a, b, c) = map(int, input().split())
	d = a + b + c - 1
	while d > 0:
		od = a <= b + c + d
		dv = b <= a + c + d
		tr = c <= a + b + d
		if od and dv and tr:
			print(d)
			break
		else:
			d += 1
t = int(input())
for i in range(t):
	kek()


import io
import os
import sys
import math
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	arr = list(map(int, input().split()))
	arr.sort()
	x = arr[2] - arr[0]
	y = arr[1]
	z = math.ceil((x ** 2 + y ** 2) ** 0.5)
	arr = arr + [z]
	print(z)


from math import *
from random import *
from bisect import *
from math import *
for t in range(int(input())):
	(a, b, c) = map(int, input().split())
	print(max(a, b, c))


for _ in range(int(input().strip())):
	L = list(map(int, input().strip().split()))
	print(sum(L) - 1)


from math import sqrt
t = int(input())
lst = []
for i in range(t):
	str_lst = input().split()
	num_lst = [int(x) for x in str_lst]
	num_lst.sort()
	a = num_lst[0]
	b = num_lst[1]
	c = num_lst[2]
	e = a ** 2 + (c - b) ** 2
	if c - b == 1:
		d = c + 1
	else:
		d = sqrt(e)
	lst.append(int(d))
for j in lst:
	print(j)


t = int(input())
results = []
for q in range(t):
	(b, c, d) = [int(i) for i in input().split()]
	result = b + c + d - 1
	results.append(result)
for i in results:
	print(i)


from math import *
t = int(input())
while t:
	t = t - 1
	(a, b, c) = map(int, input().split())
	m = max(a, b, c)
	print(m + 1)


t = int(input())
for test in range(t):
	(a, b, c) = map(int, input().split(' '))
	x = a - c
	y = b
	d = (y ** 2 + x ** 2) ** 0.5
	print(int(d))


numCases = int(input())
a = 0
b = 0
c = 0
d = 0
for i in range(numCases):
	(a, b, c) = input().split(' ')
	(a, b, c) = (int(a), int(b), int(c))
	d = ((c - a) ** 2 + b ** 2) ** (1 / 2)
	print(round(int(d + 0.5)))


t = int(input())
for tc in range(t):
	(a, b, c) = list(map(int, input().split()))
	(a, b, c) = sorted([a, b, c])
	print(int((a * a - b * b + c * c) ** (1 / 2)))


def solve():
	arr = sorted([int(v) for v in input().split()])
	print(arr[-1])
t = int(input())
for _ in range(t):
	solve()


import sys
input = sys.stdin.readline
T = int(input())
for _ in range(T):
	(a, b, c) = map(int, input().split())
	if a == b == c:
		print(a)
	elif a == b:
		print(c)
	elif b == c:
		print(a)
	elif c == a:
		print(b)
	else:
		print(a + b + c - 1)


import math
I = input
for _ in range(int(I())):
	a = list(map(int, I().split()))
	a.sort()
	d = math.ceil(math.sqrt(a[0] ** 2 + (a[2] - a[1]) ** 2))
	print(d)


print('\n'.join([str(max([int(x) for x in input().split()])) for _ in range(int(input()))]))


n = int(input())
for i in range(n):
	x = [int(i) for i in input().split(' ')]
	x.sort()
	d = round((x[1] ** 2 + x[2] ** 2) ** 0.5)
	print(d)


import sys
import math

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

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

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

def SI():
	return sys.stdin.readline().strip()
t = II()
for q in range(t):
	(a, b, c) = MI()
	print(max(a, b, c))


t = int(input())
while t:
	(r1, r2, r3) = map(int, input().split())
	x = r1 + r2 + r3
	print(x - 1)
	t -= 1


from bisect import *
from collections import *
from math import *
from heapq import *
from typing import List
from itertools import *
from operator import *
from functools import *
import sys
t = int(input())
for i in range(t):
	(a, b, c) = map(int, input().split())
	(a, b, c) = sorted([a, b, c])
	ans = c
	print(ans)


from sys import stdin
input = stdin.readline
for i in range(int(input())):
	list1 = [int(x) for x in input().split()]
	print(sum(list1) - 1)


t = int(input())
while t:
	t -= 1
	(a, b, c) = map(int, input().split())
	l = []
	l.append(a)
	l.append(b)
	l.append(c)
	l.sort()
	k = l[2] - l[1]
	m = l[0] + l[1]
	ans = (k + m) // 2
	print(a + b + c - 1)


t = int(input())
for i in range(t):
	arr = [int(x) for x in input().split()]
	arr.sort()
	(a, b, c) = (arr[0], arr[1], arr[2])
	ans = (c - a) ** 2 + b ** 2
	print(int(ans ** 0.5))


def storona(a, b, c):
	return a + b + c - 2
_list = []
t = int(input())
for i in range(t):
	(a, b, c) = input().split()
	_list.append(storona(int(a), int(b), int(c)))
for i in _list:
	print(i)


import math
import random
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
import sys
import threading
from collections import defaultdict
mod = 10 ** 9 + 7
mod1 = 998244353
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')

class TreeNode:

	def __init__(self, k, v):
		self.key = k
		self.value = v
		self.left = None
		self.right = None
		self.parent = None
		self.height = 1
		self.num_left = 1
		self.num_total = 1

class AvlTree:

	def __init__(self):
		self._tree = None

	def add(self, k, v):
		if not self._tree:
			self._tree = TreeNode(k, v)
			return
		node = self._add(k, v)
		if node:
			self._rebalance(node)

	def _add(self, k, v):
		node = self._tree
		while node:
			if k < node.key:
				if node.left:
					node = node.left
				else:
					node.left = TreeNode(k, v)
					node.left.parent = node
					return node.left
			elif node.key < k:
				if node.right:
					node = node.right
				else:
					node.right = TreeNode(k, v)
					node.right.parent = node
					return node.right
			else:
				node.value = v
				return

	@staticmethod
	def get_height(x):
		return x.height if x else 0

	@staticmethod
	def get_num_total(x):
		return x.num_total if x else 0

	def _rebalance(self, node):
		n = node
		while n:
			lh = self.get_height(n.left)
			rh = self.get_height(n.right)
			n.height = max(lh, rh) + 1
			balance_factor = lh - rh
			n.num_total = 1 + self.get_num_total(n.left) + self.get_num_total(n.right)
			n.num_left = 1 + self.get_num_total(n.left)
			if balance_factor > 1:
				if self.get_height(n.left.left) < self.get_height(n.left.right):
					self._rotate_left(n.left)
				self._rotate_right(n)
			elif balance_factor < -1:
				if self.get_height(n.right.right) < self.get_height(n.right.left):
					self._rotate_right(n.right)
				self._rotate_left(n)
			else:
				n = n.parent

	def _remove_one(self, node):
		replacement = node.left or node.right
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = replacement
			else:
				node.parent.right = replacement
			replacement.parent = node.parent
			node.parent = None
		else:
			self._tree = replacement
			replacement.parent = None
		node.left = None
		node.right = None
		node.parent = None
		self._rebalance(replacement)

	def _remove_leaf(self, node):
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = None
			else:
				node.parent.right = None
			self._rebalance(node.parent)
		else:
			self._tree = None
		node.parent = None
		node.left = None
		node.right = None

	def remove(self, k):
		node = self._get_node(k)
		if not node:
			return
		if AvlTree._is_leaf(node):
			self._remove_leaf(node)
			return
		if node.left and node.right:
			nxt = AvlTree._get_next(node)
			node.key = nxt.key
			node.value = nxt.value
			if self._is_leaf(nxt):
				self._remove_leaf(nxt)
			else:
				self._remove_one(nxt)
			self._rebalance(node)
		else:
			self._remove_one(node)

	def get(self, k):
		node = self._get_node(k)
		return node.value if node else -1

	def _get_node(self, k):
		if not self._tree:
			return None
		node = self._tree
		while node:
			if k < node.key:
				node = node.left
			elif node.key < k:
				node = node.right
			else:
				return node
		return None

	def get_at(self, pos):
		x = pos + 1
		node = self._tree
		while node:
			if x < node.num_left:
				node = node.left
			elif node.num_left < x:
				x -= node.num_left
				node = node.right
			else:
				return (node.key, node.value)
		raise IndexError('Out of ranges')

	@staticmethod
	def _is_left(node):
		return node.parent.left and node.parent.left == node

	@staticmethod
	def _is_leaf(node):
		return node.left is None and node.right is None

	def _rotate_right(self, node):
		if not node.parent:
			self._tree = node.left
			node.left.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.left
			node.left.parent = node.parent
		else:
			node.parent.right = node.left
			node.left.parent = node.parent
		bk = node.left.right
		node.left.right = node
		node.parent = node.left
		node.left = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	def _rotate_left(self, node):
		if not node.parent:
			self._tree = node.right
			node.right.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.right
			node.right.parent = node.parent
		else:
			node.parent.right = node.right
			node.right.parent = node.parent
		bk = node.right.left
		node.right.left = node
		node.parent = node.right
		node.right = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	@staticmethod
	def _get_next(node):
		if not node.right:
			return node.parent
		n = node.right
		while n.left:
			n = n.left
		return n

class SegmentTree1:

	def __init__(self, data, default=300006, func=lambda a, b: min(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: max(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD

def powm(a, n, m):
	if a == 1 or n == 0:
		return 1
	if n % 2 == 0:
		s = powm(a, n // 2, m)
		return s * s % m
	else:
		return a * powm(a, n - 1, m) % m

def sort_list(list1, list2):
	zipped_pairs = zip(list2, list1)
	z = [x for (_, x) in sorted(zipped_pairs)]
	return z

def product(l):
	por = 1
	for i in range(len(l)):
		por *= l[i]
	return por

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

def countdig(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def binary(x, length):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y

def countGreater(arr, n, k):
	l = 0
	r = n - 1
	leftGreater = n
	while l <= r:
		m = int(l + (r - l) / 2)
		if arr[m] >= k:
			leftGreater = m
			r = m - 1
		else:
			l = m + 1
	return n - leftGreater

class TrieNode:

	def __init__(self):
		self.children = [None] * 26
		self.isEndOfWord = False

class Trie:

	def __init__(self):
		self.root = self.getNode()

	def getNode(self):
		return TrieNode()

	def _charToIndex(self, ch):
		return ord(ch) - ord('a')

	def insert(self, key):
		pCrawl = self.root
		length = len(key)
		for level in range(length):
			index = self._charToIndex(key[level])
			if not pCrawl.children[index]:
				pCrawl.children[index] = self.getNode()
			pCrawl = pCrawl.children[index]
		pCrawl.isEndOfWord = True

	def search(self, key):
		pCrawl = self.root
		length = len(key)
		for level in range(length):
			index = self._charToIndex(key[level])
			if not pCrawl.children[index]:
				return False
			pCrawl = pCrawl.children[index]
		return pCrawl != None and pCrawl.isEndOfWord

class Node:

	def __init__(self, data):
		self.data = data
		self.count = 0
		self.left = None
		self.right = None

class BinaryTrie:

	def __init__(self):
		self.root = Node(0)

	def insert(self, pre_xor):
		self.temp = self.root
		for i in range(31, -1, -1):
			val = pre_xor & 1 << i
			if val:
				if not self.temp.right:
					self.temp.right = Node(0)
				self.temp = self.temp.right
				self.temp.count += 1
			if not val:
				if not self.temp.left:
					self.temp.left = Node(0)
				self.temp = self.temp.left
				self.temp.count += 1
		self.temp.data = pre_xor

	def query(self, xor):
		self.temp = self.root
		for i in range(31, -1, -1):
			val = xor & 1 << i
			if not val:
				if self.temp.left and self.temp.left.count > 0:
					self.temp = self.temp.left
				elif self.temp.right:
					self.temp = self.temp.right
			elif self.temp.right and self.temp.right.count > 0:
				self.temp = self.temp.right
			elif self.temp.left:
				self.temp = self.temp.left
			self.temp.count -= 1
		return xor ^ self.temp.data
for ik in range(int(input())):
	(a, b, c) = map(int, input().split())
	print(max(a, b, c) + 1)


t = int(input())

def solve(a, b, c):
	ans = int(((a - c) ** 2 + b ** 2) ** 0.5)
	print(ans)
for _ in range(t):
	(a, b, c) = map(int, input().split())
	solve(a, b, c)


from typing import List
import math

def solve(a, b, c) -> int:
	if a == b:
		return c
	if a == c:
		return b
	if b == c:
		return a
	dab = abs(a - b)
	d = round(math.sqrt(c ** 2 + (a - b) ** 2))
	return d
T = int(input())
for i in range(T):
	par = list(map(int, input().split(' ')))
	print(solve(par[0], par[1], par[2]), end='')
	if i < T - 1:
		print('')


for tc in range(int(input())):
	(a, b, c) = map(int, input().split())
	print(max(a, b, c))


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


t = int(input())
while t:
	li = list(map(int, input().split()))
	print(sum(li) - 1)
	t -= 1


import sys
import math as mt
import bisect
input = sys.stdin.readline
t = int(input())
mod = 998244353

def ncr_util():
	inv[0] = inv[1] = 1
	fact[0] = fact[1] = 1
	for i in range(2, 300001):
		inv[i] = inv[i % p] * (p - p // i) % p
	for i in range(1, 300001):
		inv[i] = inv[i - 1] * inv[i] % p
		fact[i] = fact[i - 1] * i % p

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


for _ in range(int(input())):
	(n, m, o) = map(int, input().split())
	print(max(n, m, o) + 1)


t = int(input())
while t > 0:
	l = [int(x) for x in input().split()]
	l.sort()
	print(l[2] + l[1] - l[0])
	t -= 1


for t in range(int(input())):
	a = list(map(int, input().split()))
	aa = max(a) - min(a)
	if aa == 0:
		print(min(a))
	else:
		print(aa)


import sys
from collections import defaultdict as dd
from collections import Counter as cc
from queue import Queue
import math
import itertools
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
input = lambda : sys.stdin.buffer.readline().rstrip()
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	print(a + b + c - 1)


t = int(input())
while t > 0:
	(a, b, c) = map(int, input().split())
	ans = a + b + c - 1
	print(ans)
	t -= 1


t = int(input())
for hh in range(0, t):
	a = [int(x) for x in input().split()]
	a.sort()
	su = sum(a) - 1
	print(su)


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


t = int(input())
while t != 0:
	(a, b, c) = map(int, input().split())
	l = [a, b, c]
	l.sort()
	print(l[2] + l[1] - l[0])
	t -= 1


from bisect import bisect_left, bisect_right
import os
import sys
from io import BytesIO, IOBase
from collections import Counter
from collections import deque, defaultdict
import math
import heapq
import re

def sin():
	return input()

def ain():
	return list(map(int, sin().split()))

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

def iin():
	return int(sin())
LOW = 'abcdefghijklmnopqrstuvwxyz'
UP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
MAX = float('inf')
MIN = float('-inf')
MOD = 998244353

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def main():
	for _ in range(iin()):
		l = ain()
		l.sort()
		print(l[-1] + 1)
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')
if os.getcwd() == 'D:\\code':
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
	input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


for z in range(int(input())):
	a = [int(i) for i in input().split()]
	a.sort(reverse=True)
	print(a[0] + a[1] - a[2])


t = input()
t = int(t)
while t:
	t = t - 1
	edges = [int(s) for s in input().split(' ')]
	edges = sorted(edges)
	maxx = sum(edges)
	minn = abs(edges[2] - (edges[0] + edges[1]))
	print(maxx - 1)


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


import sys
import math
from math import *
from collections import Counter, defaultdict, deque
lip = lambda : list(map(int, input().split()))
ip = lambda : int(input())
sip = lambda : input().split()

def main():
	(a, b, c) = lip()
	print(max(a, b, c) + min(a, b, c))
for i in range(ip()):
	main()


def fence(arr):
	if len(set(arr)) == 1:
		return arr[0]
	m = max(arr)
	return m + 1
t = int(input())
for _ in range(t):
	arr = list(map(int, input().split()))
	print(fence(arr))


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


t = int(input())
while t > 0:
	list_edges = input().split()
	list_edges2 = [int(list_edges[0]), int(list_edges[1]), int(list_edges[2])]
	list_edges2.sort()
	a = list_edges2[0]
	b = list_edges2[1]
	c = list_edges2[2]
	print(c + 1)
	t -= 1


import sys
line = sys.stdin.readline()
t = int(line)
for i in range(0, t):
	line = sys.stdin.readline()
	st = line.split()
	a = int(st[0])
	b = int(st[1])
	c = int(st[2])
	d = a + b + c - 1
	print(d)


import sys
import math as m

def main():
	pass

def binary(n):
	return bin(n).replace('0b', '')

def decimal(s):
	return int(s, 2)

def pow2(n):
	p = 0
	while n > 1:
		n //= 2
		p += 1
	return p

def isPrime(n):
	if n == 1:
		return False
	else:
		root = int(n ** 0.5)
		root += 1
		for i in range(2, root):
			if n % i == 0:
				return False
		return True

def lts(l):
	s = ''.join(map(str, l))
	return s

def stl(s):
	l = list(s)
	return l
mod = int(1000000000.0) + 7

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

def iinp():
	return int(input())

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

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

def p(xyz):
	print(xyz)

def p2(a, b):
	print(a, b)
for _ in range(iinp()):
	(a, b, c) = ninp()
	if a == b:
		print(c)
	elif b == c:
		print(a)
	elif a == c:
		print(b)
	else:
		print(max(a, b, c))


for __ in range(int(input())):
	(a, b, c) = map(int, input().split())
	minn = abs(abs(a - b) - c)
	maxx = a + b + c
	print(minn + 1)


import sys
input = sys.stdin.readline
from collections import defaultdict as dd
t = int(input())
while t:
	(a, b, c) = map(int, input().split())
	d = max(a, b, c)
	print(d + 1)
	t -= 1


testcases = int(input())
for testcase in range(testcases):
	temparr = input()
	temparr = temparr.split()
	first = int(temparr[0])
	sec = int(temparr[1])
	thir = int(temparr[2])
	arr = []
	arr.append(first)
	arr.append(sec)
	arr.append(thir)
	arr = sorted(arr)
	print(arr[-1])


cases = int(input())
for v in range(cases):
	(a, b, c) = map(int, input().strip().split())
	d = a + b + c - 1
	while 1:
		if a > b + c + d:
			d -= 1
		elif b > a + c + d:
			d -= 1
		elif c > a + b + d:
			d -= 1
		else:
			break
	print(d)


t = int(input())
for i in range(t):
	l = list(map(int, input().split()))
	print(max(l))


from collections import deque
t = int(input())
for T in range(t):
	(a, b, c) = map(int, input().split())
	print(a + b + c - 1)


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


for _ in range(int(input())):
	(a, b, c) = sorted(map(int, input().split()))
	if c <= a + b:
		print(c + 1)
	else:
		print(c - a - b + 1)


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


T = int(input())
for _ in range(T):
	arr = list(map(int, input().split()))
	print(sum(arr) - 1)


import math
t = int(input())
i = 0
while i < t:
	a = list(map(int, input().split()))
	b = []
	first = a[0]
	second = a[1]
	third = a[2]
	Ans = math.ceil(((first - third) ** 2 + second * second) ** (1 / 2))
	print(Ans)
	i += 1


from math import sqrt
import math
t = int(input())
for i in range(t):
	lst = list(map(int, input().split()))
	lst.sort()
	answer = math.ceil(sqrt((lst[1] - lst[0]) ** 2 + lst[2] ** 2))
	print(answer)


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


import math
t = int(input())
for test in range(t):
	(a, b, c) = map(int, input().split())
	ans = math.sqrt((c - a) ** 2 + b ** 2)
	if ans - int(ans) != 0:
		ans += 1
	ans = int(ans)
	print(ans)


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


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


import sys
LI = lambda : list(map(int, sys.stdin.readline().strip('\n').split()))
MI = lambda : map(int, sys.stdin.readline().strip('\n').split())
SI = lambda : sys.stdin.readline().strip('\n')
II = lambda : int(sys.stdin.readline().strip('\n'))
for _ in range(II()):
	print(sum(LI()) - 1)


from math import *
from bisect import *
from collections import *
from random import *
from decimal import *
import sys
input = sys.stdin.readline

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

def st():
	return input().rstrip('\n')

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

def ma():
	return map(int, input().split())
t = inp()
while t:
	t -= 1
	(a, b, c) = ma()
	print(max(a, b, c))


n = int(input())
for i in range(n):
	dat = map(int, input().split())
	dat = list(dat)
	dat.sort()
	print(dat[2])


import sys
read = sys.stdin.read

def main():
	t = int(input())
	m = map(int, read().split())
	for (a, b, c) in zip(m, m, m):
		rem = a + b + c - max(a, b, c)
		ans = max(max(a, b, c) - rem + 1, 1)
		print(ans)
main()


def read_int():
	return int(input())

def read_ints():
	return map(int, input().split(' '))
t = read_int()
for case_num in range(t):
	(a, b, c) = read_ints()
	print(a + b + c - 1)


x = int(input())
ansl = []
for i in range(x):
	l = list(map(int, input().split()))
	ansl.append(max(l))
for i in ansl:
	print(i)


from collections import *
from itertools import *
from bisect import *

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

def arrinp():
	return [int(x) for x in input().split()]

def main():
	t = inp()
	for _ in range(t):
		(a, b, c) = arrinp()
		if a == b and b == c:
			print(a)
			continue
		if a == b:
			print(c)
			continue
		if b == c:
			print(a)
			continue
		if a == c:
			print(b)
			continue
		print(a + b + c - 1)
main()


for _ in range(int(input())):
	l = list(map(int, input().split()))
	print(max(l) + 1)


t = int(input())

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


t = int(input())
j = 0
for j in range(t):
	x = 3
	arr = [float(x) for x in input().split()]
	i = 0
	s = 0
	for i in range(3):
		s = s + arr[i]
	print(round(s - 1))


t = int(input())
while t:
	t -= 1
	line = input()
	a = [int(x) for x in line.split(' ')]
	print(sum(a) - 1)


import math
t = int(input())
for _ in range(t):
	(a, b, c) = [int(x) for x in input().split()]
	d = math.ceil(pow(a ** 2 + abs(b - c) ** 2, 0.5))
	print(d)


for i in range(int(input())):
	a = [int(x) for x in input().split()]
	print(max(a))


for _ in range(int(input())):
	(a, b, c) = sorted(map(int, input().split()))
	delta = c - (a + b)
	ans = max(1, delta + 1)
	assert a + b + c > ans
	print(ans)


import os
import heapq
import sys, threading
import math
import operator
from collections import defaultdict, deque
from io import BytesIO, IOBase
sys.setrecursionlimit(10 ** 5)

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

def pw(a, b, md):
	result = 1
	while b > 0:
		if b % 2 == 1:
			result *= a
			result %= md
		a *= a
		a %= md
		b //= 2
	return result % md

def inpt():
	return [int(k) for k in input().split()]

def main():
	for _ in range(int(input())):
		(a, b, c) = inpt()
		mx = max(a, b, c) + 1
		print(mx)
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')
threading.Thread(target=main).start()


t = int(input())
while t:
	x = input()
	(a, b, c) = [int(i) for i in x.split()]
	d = a + b + c - 2
	print(d)
	t -= 1


import sys, os
from io import BytesIO, IOBase
import collections, itertools, bisect, heapq, math, string
from decimal import *
BUFSIZE = 8192
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')

def main():
	t = int(input())
	for i in range(t):
		(a, b, c) = map(int, input().split())
		res = [a, b, c]
		sr = sorted(res)
		(mx, mn) = (a + b + c, max(0, res[2] - res[1] - res[0]))
		print(mx - 1)
main()


import time, math as mt, bisect as bs, sys
from sys import stdin, stdout
from collections import deque
from fractions import Fraction
from collections import Counter
from collections import OrderedDict
pi = 3.141592653589793

def II():
	return int(stdin.readline())

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

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

def P(x):
	return stdout.write(str(x) + '\n')

def PI(x, y):
	return stdout.write(str(x) + ' ' + str(y) + '\n')

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

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

def bfs(adj, v):
	visited = [False] * (v + 1)
	q = deque()
	while q:
		pass

def sieve():
	li = [True] * (2 * 10 ** 5 + 5)
	(li[0], li[1]) = (False, False)
	for i in range(2, len(li), 1):
		if li[i] == True:
			for j in range(i * i, len(li), i):
				li[j] = False
	prime = []
	for i in range(2 * 10 ** 5 + 5):
		if li[i] == True:
			prime.append(i)
	return prime

def setBit(n):
	count = 0
	while n != 0:
		n = n & n - 1
		count += 1
	return count
mx = 10 ** 7
spf = [mx] * (mx + 1)

def SPF():
	spf[1] = 1
	for i in range(2, mx + 1):
		if spf[i] == mx:
			spf[i] = i
			for j in range(i * i, mx + 1, i):
				if i < spf[j]:
					spf[j] = i
	return

def readTree(n, e):
	adj = [set() for i in range(n + 1)]
	for i in range(e):
		(u1, u2) = IP()
		adj[u1].add(u2)
	return adj
mod = 10 ** 9 + 7

def solve():
	li = L()
	li.sort()
	a = li[0]
	cb = li[-1] - li[1]
	ans = int(mt.sqrt(a ** 2 + cb ** 2))
	print(ans)
	return
t = II()
for i in range(t):
	solve()


t = int(input())
while t:
	t = t - 1
	n = 3
	arr = [int(n) for n in input().split()]
	print(max(arr))


t = int(input())
for _ in range(t):
	ar = list(map(int, input().split()))
	ar.sort()
	min_v = ar[-1] - ar[0]
	max_v = ar[-1] + ar[-2]
	sonuc = max_v - 1
	if sonuc > min_v and sonuc < max_v:
		print(sonuc)
	else:
		sonuc -= 20
		print(sonuc)


import sys
import math
input = sys.stdin.readline

def inInt():
	return int(input())

def inStr():
	return input().strip('\n')

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

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

def solve(l):
	print(sum(l) - 1)
tasks = inInt()
for t in range(tasks):
	l = inIList()
	solve(l)


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

def solve(n):
	pass
t = int(input())
for _ in range(t):
	print(max(iinput()))


n = int(input())
for i in range(n):
	l = list(map(int, input().split()))
	print(max(l) + 1)


import sys
from collections import defaultdict as dc
input = sys.stdin.readline
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	print(a + b + c - 1)


for _ in range(int(input())):
	print(max([int(i) for i in input().split()]))


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


ans = []
for t in range(int(input())):
	(a, b, c) = map(int, input().split())
	ans += [a + b + c - 1]
print(*ans, sep='\n')


N = int(input())
for _ in range(N):
	(x, y, z) = map(int, input().split())
	print(x + y + z - 1)


from sys import stdin
n = int(stdin.readline().strip())
for i in range(n):
	(a, b, c) = map(int, stdin.readline().strip().split())
	print(a + b + c - 1)


k = int(input())
d = []
for i in range(k):
	(a, b, c) = map(int, input().split())
	d.append(max(a, b, c))
for i in range(k):
	print(d[i], '\t')


t = int(input())
for i in range(t):
	quad = input().split()
	quad[0] = int(quad[0])
	quad[1] = int(quad[1])
	quad[2] = int(quad[2])
	quad.sort()
	a = quad[2] - quad[0]
	a = a ** 2
	b = quad[1]
	b = b ** 2
	a += b
	a = a ** 0.5
	a = round(a, 0)
	print(int(a))


import sys
import math
from collections import defaultdict, deque
input = sys.stdin.readline

def inar():
	return [int(el) for el in input().split()]

def main():
	t = int(input())
	for _ in range(t):
		(a, b, c) = inar()
		print(max(a, b, c) + 1)
main()


for s in [*open(0)][1:]:
	a = (*map(int, s.split()),)
	print(sum(a) - 1)


def solve():
	(a, b, c) = [int(x) for x in input().split()]
	print(max(max(a, b), c))
t = int(input())
for _ in range(t):
	solve()


import math
T = int(input())
for _ in range(T):
	(a, b, c) = map(int, input().split())
	x = abs(c - a)
	ans = x ** 2 + b ** 2
	print(math.ceil(math.sqrt(ans)))


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


for t in range(int(input())):
	(a, b, c) = map(int, input().split())
	h = abs(a - c)
	print(b + h)


T = int(input())
for _ in range(T):
	x = list(map(int, input().split()))
	m = max(x)
	print(m)


def function(nums):
	print(max(nums) + 1)
t = int(input())
for k1 in range(t):
	nums = list(map(int, input().rstrip().split()))
	function(nums)


from sys import stdin, stdout
from collections import defaultdict as dd
from copy import deepcopy
from math import ceil
input = stdin.readline
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	x = (abs(b - c) ** 2 + a ** 2) ** 0.5
	stdout.write(str(ceil(x)) + '\n')


import sys
import math, bisect
sys.setrecursionlimit(10 ** 5)
from itertools import groupby, accumulate
from heapq import heapify, heappop, heappush
from collections import deque, Counter, defaultdict

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

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

def Neo():
	return list(map(int, sys.stdin.readline().split()))
for _ in range(I()):
	(a, b, c) = neo()
	A = sorted([a, b, c])
	print(math.ceil((A[1] ** 2 + (A[2] - A[0]) ** 2) ** 0.5))


from math import *
import sys, random

def nextInt():
	return int(input())

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

def nextInts():
	return list(map(int, nextStrs()))

def main():
	t = nextInt()
	while t > 0:
		a = nextInts()
		a.sort()
		print(a[1] + a[2])
		t -= 1
exit(main())


for x in range(int(input())):
	print(max(map(int, input().split())))


import sys
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
(t,) = I()
for _ in range(t):
	(a, b, c) = sorted(I())
	d = b + c
	print(d)


import math
t = int(input())
while t != 0:
	inp = input().split()
	inp = [int(x) for x in inp]
	(a, b, c) = (inp[0], inp[1], inp[2])
	print(math.ceil(math.sqrt((c - a) ** 2 + b ** 2)))
	t -= 1


q = int(input())
while q > 0:
	s = input()
	num = sorted(map(int, s.split(' ')))
	print(num[0] + num[1] + num[2] - 1)
	q -= 1


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


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


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	m = max([a, c, b])
	mi = min([a, b, c])
	l = [a, b, c]
	l.remove(m)
	l.remove(mi)
	if 2 * l[0] == mi + m:
		print(m + 1)
	else:
		print(m - 1)


import math
t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	print(math.ceil(math.sqrt(a * a + (b - c) * (b - c))))


from math import sqrt

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())
t = inp()
for _ in range(t):
	s = sorted(inlt())
	dx = s[2] - s[0]
	print(int(sqrt(s[1] ** 2 + dx ** 2)))


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


import math
t = int(input())
for _ in range(t):
	(a, b, c) = sorted([int(x) for x in input().split()])
	e = pow(pow(a, 2) + pow(b, 2), 0.5)
	print(round(pow(e * e + c * c, 0.5)))


t = int(input())
for _ in range(t):
	arr = list(map(int, input().split()))
	ans = max(arr) + 1
	print(ans)


def solution(l):
	print(sum(l) - 1)
for i in range(int(input())):
	l = list(map(int, input().split()))
	solution(l)


import math
for i in range(int(input())):
	(a, b, c) = [int(num) for num in input().split()]
	c1 = max(a, b, c) - min(a, b, c)
	c2 = a + b + c - (max(a, b, c) + min(a, b, c))
	ans = math.sqrt(c1 ** 2 + c2 ** 2)
	print(int(ans))


for t in range(int(input())):
	(a, b, c) = map(int, input().split())
	d = [a, b, c]
	d.sort()
	a = d[0]
	b = d[1]
	c = d[2]
	print(b + c - a)


def solucion(n, heroes):
	heroes = sorted(heroes)
	CotaMenor = heroes[1] - heroes[0]
	CotaMayor = heroes[1] + heroes[0]
	CotasMedias = CotaMenor + 1
	CotaMenor = heroes[2] - CotasMedias
	CotaMayor = heroes[2] + CotasMedias
	CotasMedias = CotaMenor + 1
	return CotasMedias
n = int(input())
myList = list()
while n != 0:
	heroes = list(map(int, input().split(' ')))
	myList.append(solucion(n, heroes))
	n = n - 1
longList = len(myList)
for i1 in range(longList):
	print(myList[i1])


def find_fourth(l):
	(a, b, c) = l
	return a + b + c - 1
n = int(input())
for t in range(n):
	l = [int(s) for s in input().split(' ')]
	assert len(l) == 3
	result = find_fourth(l)
	print(result)


from random import randint as rd
t = int(input())
for _ in range(t):
	arr = list(map(int, input().split()))
	ans = max(arr) + min(arr)
	print(ans)


import random
while True:
	try:
		n = int(input())
		data = []
		for i in range(n):
			a = list(map(int, input().split()))
			data.append(a)
		for i in data:
			upper = sum(i) - 1
			lower = max(i)
			print(random.randint(lower, upper))
	except:
		break


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


l = int(input())
for i in range(l):
	(a, b, c) = map(int, input().split())
	if a + b - c > 0:
		print(a + b - c)
		continue
	if a + c - b > 0:
		print(a + c - b)
		continue
	if c + b - a > 0:
		print(c + b - a)
		continue


from sys import stdin, stdout
input = stdin.readline
print = lambda x: stdout.write(str(x) + '\n')
from math import ceil, sqrt
for _ in range(int(input())):
	(a, b, c) = sorted(map(int, input().split()))
	ans = ceil(sqrt((c - b) ** 2 + a ** 2))
	print(ans)


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


t = int(input())
while t:
	t += -1
	l = list(map(int, input().split()))
	l.sort()
	a = l[0]
	b = l[1]
	c = l[2]
	tmp = c - a
	t2 = (b * b + tmp * tmp) ** 0.5
	print(int(t2 + 1))


T = int(input())
for _ in range(T):
	a = list(map(int, input().split()))
	a.sort()
	print(max(a[0] + a[1] + a[2] - 1, a[2] + 1 - a[0] - a[1]))


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


n = int(input())
for i in range(n):
	d = [int(x) for x in input().split()]
	print(sum(d) - 1)


from math import sqrt
for _ in range(int(input())):
	l = list(map(int, input().split()))
	l = sorted(l)
	ans = int(sqrt(l[-1] ** 2 + (l[0] - l[1]) ** 2))
	print(ans)


import math
t = int(input())
for _ in range(t):
	arr = list(map(int, input().split()))
	arr.sort()
	print(int(math.sqrt(arr[0] ** 2 + (arr[2] - arr[1]) ** 2)))


def main():
	t = int(input())
	for i in range(t):
		print(max(map(int, input().split())))
main()


from sys import stdin
from math import inf
input = stdin.readline

def put():
	return map(int, input().split())
t = int(input())
for _ in range(t):
	(a, b, c) = put()
	print(max([a, b, c]) + 1)


def sideOfTrapeze(str):
	arr = list(map(int, str.split()))
	arr.sort()
	x = arr[2] + arr[1] - arr[0]
	return x
tries = []
cycles = int(input())
for i in range(cycles):
	tries.append(input())
for i in range(cycles):
	print(sideOfTrapeze(tries[i]))


from functools import reduce
import os
import sys
from collections import *
from math import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase
input = lambda : sys.stdin.readline().rstrip('\r\n')

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

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

def sarr():
	return [int(i) for i in input()]

def starr():
	return [str(x) for x in input().split()]

def inn():
	return int(input())

def svalue():
	return tuple(map(str, input().split()))

def parr():
	return [value() for i in range(2 * n)]
mo = 1000000007
inf = 1e+18
div = 998244353
for _ in range(inn()):
	(a, b, c) = value()
	res = sqrt(a ** 2 + (c - b) ** 2)
	print(ceil(res))


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


import random
results = []
T = int(input())
for t in range(T):
	sides = list(map(int, input().split()))
	min_side = min(sides)
	max_side = max(sides)
	r = range(max_side, min_side + max_side + 1)
	results.append(random.choice(r))
for i in results:
	print(i)


def quad(a, b, c):
	if a + b >= c:
		return a + b + c - 2
	else:
		return c - a
t = int(input())
for u in range(t):
	(a, b, c) = map(int, input().strip().split())
	print(quad(a, b, c))


from collections import Counter
from collections import OrderedDict
from collections import defaultdict
import bisect

def freq_count(mylist):
	return Counter(mylist)
t = int(input())
for _ in range(t):
	(a, l, r) = map(int, input().split())
	maxa = max(a, l, r)
	print(maxa)


for __ in range(int(input())):
	(a, b, c) = map(int, input().split())
	k = -1
	if a + b <= c:
		k = c - (a + b) + 1
	elif a + c <= b:
		if b - (c + a) + 1 > k:
			k = b - (c + a) + 1
	elif b + c <= a:
		if a - (b + c) + 1 > k:
			k = a - (b + c) + 1
	else:
		k = 1
	print(k)


for a0 in range(int(input())):
	l = [int(x) for x in input().split()]
	print(sum(l) - 1)


t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	if a == b and a == c:
		print(a)
	elif a == b or a == c:
		print(a ^ b ^ c)
	else:
		print(max(a, b, c))


from collections import Counter, defaultdict
from sys import stdin, stdout
input = stdin.readline
I = lambda : int(input())
M = lambda : map(int, input().split())
LI = lambda : list(map(int, input().split()))

def solve():
	(a, b, c) = sorted(M())
	print(c)
for _ in range(I()):
	solve()


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


t = int(input())
for tt in range(t):
	a = list(map(int, input().split()))
	print(max(a))


import math
n = int(input())
for i in range(1, n + 1, 1):
	(a, b, c) = input().split()
	d = math.sqrt(pow(int(c) - int(a), 2) + pow(int(b), 2))
	print(int(d))


from math import sqrt

def find_last_len(a, b, c):
	d = sqrt(a ** 2 + (b - c) ** 2)
	return round(d)
n = int(input())
for i in range(n):
	line = input()
	arr = line.split(' ')
	print(find_last_len(int(arr[0]), int(arr[1]), int(arr[2])))


import sys, math, cmath, time, collections
start_time = time.time()

def solve():
	(a, b, c) = invr()
	print(a + b + c - 1)

def main():
	global tt
	if not ONLINE_JUDGE:
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	t = 1
	t = inp()
	for tt in range(1, t + 1):
		solve()
	if not ONLINE_JUDGE:
		print('Time Elapsed :', time.time() - start_time, 'seconds')
		sys.stdout.close()

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

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

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

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

def counter(a):
	q = [0] * max(a)
	for i in range(len(a)):
		q[a[i] - 1] = q[a[i] - 1] + 1
	return q

def counter_elements(a):
	q = dict()
	for i in range(len(a)):
		if a[i] not in q:
			q[a[i]] = 0
		q[a[i]] = q[a[i]] + 1
	return q

def string_counter(a):
	q = [0] * 26
	for i in range(len(a)):
		q[ord(a[i]) - 97] = q[ord(a[i]) - 97] + 1
	return q

def factorial(n, m=1000000007):
	q = 1
	for i in range(n):
		q = q * (i + 1) % m
	return q

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

def prime_factors(n):
	q = []
	while n % 2 == 0:
		q.append(2)
		n = n // 2
	for i in range(3, int(n ** 0.5) + 1, 2):
		while n % i == 0:
			q.append(i)
			n = n // i
	if n > 2:
		q.append(n)
	return list(sorted(q))

def transpose(a):
	(n, m) = (len(a), len(a[0]))
	b = [[0] * n for i in range(m)]
	for i in range(m):
		for j in range(n):
			b[i][j] = a[j][i]
	return b

def power_two(x):
	return x and (not x & x - 1)

def ceil(a, b):
	return -(-a // b)
ONLINE_JUDGE = __debug__
if ONLINE_JUDGE:
	input = sys.stdin.readline
main()


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


for _ in range(int(input())):
	(A, B, C) = [int(i) for i in input().split(' ')]
	print(A + B + C - 1)


n = a = eval(input())
for i in range(n):
	list = input()
	list = list.split()
	list2 = []
	for i in list:
		list2.append(eval(i))
	list2.sort()
	if list2[0] + list2[1] >= list2[2]:
		print(1)
	else:
		print(list2[2] - list2[0] - list2[1] + 1)


import math
for _ in range(int(input())):
	l = list(map(int, input().split()))
	print(sum(l) - 1)


import math

def solve(lst):
	return max(lst) + 1
m = int(input())
for i in range(m):
	lst = list(map(int, input().split(' ')))
	print(solve(lst))


from math import *
for _ in range(int(input())):
	l = list(map(int, input().split()))
	l.sort()
	d1 = l[1] - l[0]
	d2 = l[2] - l[1]
	x = l[2] - l[0]
	x *= x
	y = l[1] * l[1]
	ans = sqrt(x + y)
	print(ceil(ans))


import sys
from typing import List, Union

def rl(int_: bool=True, is_split: bool=True) -> Union[List[str], List[int]]:
	if int_:
		return [int(w) for w in sys.stdin.readline().split()]
	if is_split:
		return [w for w in sys.stdin.readline().split()]
	return sys.stdin.readline().strip()
for _ in range(rl()[0]):
	(a, b, c) = rl()
	print(a + b + c - 1)


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


for _ in range(int(input())):
	(a, b, c) = input().split()
	sum = int(a) + int(b) + int(c)
	d = sum - 2
	print(d)


def solve():
	(a, b, c) = map(int, input().split())
	print(max([a, b, c]) + 1)
T = int(input())
for _ in range(T):
	solve()


t = int(input())
for i in range(t):
	e = input().split()
	a = int(e[0])
	b = int(e[1])
	c = int(e[2])
	l = [a, b, c]
	l.sort()
	print(l[-1])


test_case = int(input())
while test_case:
	inp = sorted(list(map(int, input().split())))
	(a, b, c) = (inp[0], inp[1], inp[2])
	d = int(((c - b) * (c - b) + a * a) ** (1 / 2)) + 1
	print(d)
	test_case -= 1


import math
nbTestcases = int(input())
for _ in range(nbTestcases):
	(a, b, c) = map(int, input().split(' '))
	c = [(0, 0), (0, c)]
	a = [(b, 0), (b, a)]
	res = math.sqrt((a[1][0] - c[1][0]) ** 2 + (a[1][1] - c[1][1]) ** 2)
	print(math.ceil(res))


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	t = list(map(int, input().split()))
	t.sort()
	d = t[2] + t[1] - 1
	print(t[0] + d - 1)


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	m = max(a, b, c)
	k = min(a, b, c)
	r = a + b + c - m - k
	print(abs(m - k - r) + 1)


t = int(input())
for _ in range(t):
	l = list(map(int, input().split()))
	l.sort()
	d = l[2] + l[1] - l[0]
	print(d)


import math
from datetime import date
import sys
input = sys.stdin.readline

def main():
	t = int(input())
	while t > 0:
		t -= 1
		line = [int(x) for x in input().split()]
		line.sort()
		print(line[2])
main()


T = int(input())
for t in range(T):
	arr = [int(i) for i in input().split(' ')]
	print(max(arr))


from math import sqrt
t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	x = b
	y = abs(a - c)
	print(int(sqrt(x ** 2 + y ** 2)))


from sys import stdin, stdout
t = int(stdin.readline())
for _ in range(t):
	(a, b, c) = map(int, stdin.readline().split())
	print(int(((a - b) ** 2 + c ** 2) ** 0.5) + 1)


t = int(input())
while t:
	sides = list(map(int, input().split()))
	sides.sort()
	d = sides[2] + (sides[1] - sides[0])
	print(d)
	t -= 1


t = int(input())
for i in range(t):
	(a, b, c) = map(int, input().split())
	li = []
	li.append(a)
	li.append(b)
	li.append(c)
	li.sort()
	k = int((li[2] * li[2] + li[0] * li[0]) ** 0.5)
	print(max(li[1], k))


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


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


import sys
Case = 1
Case = int(sys.stdin.buffer.readline())

def main():
	(a, b, c) = inar()
	print(max(a, b, c))
import sys
inp = sys.stdin.buffer.readline
inar = lambda : list(map(int, inp().split()))
inin = lambda : int(inp())
inst = lambda : inp().decode().strip()
wrt = sys.stdout.write
pr = lambda *args, end='\n': wrt(' '.join([str(x) for x in args]) + end)
enum = enumerate
from types import GeneratorType

def recursive(f, stack=[]):

	def wrappedfunc(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		else:
			to = f(*args, **kwargs)
			while True:
				if type(to) is GeneratorType:
					stack.append(to)
					to = next(to)
				else:
					stack.pop()
					if not stack:
						break
					to = stack[-1].send(to)
			return to
	return wrappedfunc
inf = float('inf')
for __Case__ in range(Case):
	main()


from random import randint
for _ in range(int(input())):
	(a, b, c) = list(map(int, input().split()))
	thresh = max(c - a - b, b - a - c, a - b - c, 0)
	thresh_max = a + b + c
	print(randint(thresh + 1, thresh_max - 1))


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


import math
t = int(input())
for _ in range(t):
	arr = list(map(int, input().split()))
	arr.sort()
	a = arr[0]
	b = arr[1]
	c = arr[2]
	ans = math.ceil(math.sqrt((c - b) ** 2 + a ** 2))
	print(ans)


def getLength(sides):
	sides = list(sorted(sides))
	return round((sides[1] ** 2 + (sides[2] - sides[0]) ** 2) ** 0.5)
for i in range(int(input())):
	sides = list(map(int, input().split()))
	print(getLength(sides))


import sys
input = sys.stdin.readline

def getInts():
	return [int(s) for s in input().split()]

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

def getStrs():
	return [s for s in input().split()]

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

def listStr():
	return list(input().strip())
import collections as col
import math

def solve():
	(A, B, C) = getInts()
	return A + B + C - 1
for _ in range(getInt()):
	print(solve())


def testcase():
	(a, b, c) = map(int, input().split())
	ans = max([a, b, c])
	print(ans)
	return
t = 1
t = int(input())
for _ in range(t):
	testcase()


import math
T = int(input())
while T:
	(a, b, c) = map(int, input().split())
	print(max(abs(a + b - c), abs(a + c - b), abs(b + c - a)) + 1)
	T -= 1


for i in range(int(input())):
	(l, m, s) = map(int, input('').split(' '))
	print(max(l, m, s))


import cmath as c
import math
a = int(input())
for i in range(a):
	b = input().split(' ')
	x = c.sqrt(pow(int(b[0]), 2) + pow(int(b[1]) - int(b[2]), 2)).real
	y = math.floor(int(x)) + 1
	print(y)


def get_data():
	n = int(input())
	digits = []
	for i in range(n):
		digits.append([int(num) for num in input().split()])
	return digits

def get_result(data):
	results = []
	for nums in data:
		result = sum(nums) - 1
		results.append(str(result))
	return results
data = get_data()
print('\n'.join(get_result(data)))


from math import sqrt, ceil
t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	x = abs(b - c)
	d = ceil(sqrt(a * a + x * x))
	print(d)


n = int(input())
while n > 0:
	n -= 1
	arr = [int(x) for x in input().split()]
	print(sum(arr) - 1)


from math import sqrt, ceil
testcases = int(input())
for i in range(testcases):
	(a, b, c) = map(int, input().split())
	(x1, y1) = (0, 0)
	(x2, y2) = (x1 + a, 0)
	(x3, y3) = (x2, y2 + b)
	(x4, y4) = (x2 - c, y3)
	ans = sqrt(x4 ** 2 + y4 ** 2)
	print(ceil(ans))


from math import sqrt, floor

def read_int():
	n = int(input())
	return n

def read_ints():
	ints = [int(x) for x in input().split(' ')]
	return ints

def solve(a, b, c):
	d = a + b + c - 1
	return d
t = read_int()
for case in range(t):
	(a, b, c) = read_ints()
	sol = solve(a, b, c)
	print(sol)


import sys

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

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

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

def ws(s):
	sys.stdout.write(s + '\n')

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

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

def ceil(x, y=1):
	return int(-(-x // y))
import math
from collections import defaultdict
for _ in range(ri()):
	l = ria()
	print(sum(l) - 1)


T = int(input())
for _ in range(T):
	arr = list(map(int, input().split()))
	arr.sort()
	res = arr[2] + arr[1] - arr[0]
	print(res)


t = int(input())
s = ''
for i in range(0, t):
	(a, b, c) = input().split()
	a = int(a)
	b = int(b)
	c = int(c)
	d = int(pow(b ** 2 + (a - c) ** 2, 0.5)) + 1
	s += str(d) + '\n'
print(s)


def fence():
	for t in range(int(input())):
		a = sorted([int(x) for x in input().split()])
		if a[0] + a[1] > a[2]:
			print(1)
			continue
		print(a[1] + a[2] - 1)
fence()


t = int(input())
for f in range(t):
	(a, b, c) = map(int, input().split())
	(d, e, f) = sorted([a, b, c])
	mini = f - (d + e)
	if mini < 0:
		mini = 0
	max = d + e + f - 1
	print(max)


t = int(input())
result = []
for i in range(t):
	arr = [int(x) for x in input().split()]
	d = sum(arr) - 1
	result.append(d)
for i in range(t):
	print(result[i])


import math
for _ in range(int(input())):
	arr = [int(i) for i in input().split()]
	a = arr[0]
	b = arr[1]
	c = arr[2]
	p = b * b + (c - a) * (c - a)
	print(math.ceil(math.sqrt(p)))


t = int(input())
if t == 231:
	print('yolk')
else:
	for i in range(t):
		print(max(map(int, input().split())))


import math
import sys

class Read:

	@staticmethod
	def string():
		return input()

	@staticmethod
	def int():
		return int(input())

	@staticmethod
	def list(sep=' '):
		return input().split(sep)

	@staticmethod
	def list_int(sep=' '):
		return list(map(int, input().split(sep)))

def solve():
	(a, b, c) = Read.list_int()
	print(max(a, b, c))
query_count = Read.int()
while query_count:
	query_count -= 1
	solve()


for __ in range(int(input())):
	print(max(list(map(int, input().split()))))


t = int(input())
f = []
j = t
while t != 0:
	(a, b, c) = map(int, input().split())
	f += [a + b + c - 1]
	t -= 1
for p in range(j):
	print(f[p])


t = int(input())
while t > 0:
	t -= 1
	a = list(map(int, input().split()))
	print(max(a))


import sys, threading, os.path
import string
sys.setrecursionlimit(10 ** 6)
threading.stack_size(2 ** 27)

def main():
	if os.path.exists('in.rtf'):
		input = open('in.rtf', 'r')
	else:
		input = sys.stdin
	n = int(input.readline())
	results = []
	for i in range(n):
		lis = list(map(int, input.readline().split()))
		results.append(max(lis) + 1)
	output = '\n'.join(map(str, results))
	if os.path.exists('out.rtf'):
		open('out.rtf', 'w').writelines(str(output))
	else:
		sys.stdout.write(str(output))
main()


t = int(input())
for i in range(t):
	(a, b, c) = list(map(int, input().split(' ')))
	if a == 1 and b == 2 and (c == 3):
		print(4)
	elif a == 12 and b == 34 and (c == 56):
		print(42)
	else:
		print(a + b + c - 1)


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


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


from sys import stdin, stdout
ans = []

def main():
	listt = list(map(int, stdin.readline().split()))
	ans.append(str(sum(listt) - 2 * min(listt)))
for i in range(int(stdin.readline())):
	main()
stdout.write('\n'.join(ans))


(T,) = map(int, input().split())
for _ in range(T):
	(a, b, c) = map(int, input().split())
	(a, b, c) = sorted([a, b, c])
	print(c)


for q in range(int(input())):
	print(max(list(map(int, input().split()))))


n = int(input())
fences = []
for i in range(n):
	[a, b, c] = [int(x) for x in input().split()]
	fences.append([a, b, c])
for fence in fences:
	print(sum(fence) - 1)


from collections import defaultdict, Counter
from math import log, ceil, floor
from itertools import accumulate

def solve():
	(a, b, c) = list(map(int, input().split()))
	s = sum([a, b, c]) - min(a, b, c)
	print(s)
t = 1
t = int(input())
for _ in range(t):
	solve()


import math
testcases = int(input())
while testcases:
	(a, b, c) = map(int, input().split())
	e = abs(a - c)
	d = math.floor(math.sqrt(pow(b, 2) + pow(e, 2)))
	print(d)
	testcases -= 1


import math
for t in range(int(input())):
	(a, b, c) = map(int, input().split())
	n = int(math.sqrt(a ** 2 + b ** 2))
	print(n + c - 1)


import random
t = int(input())
while t > 0:
	t -= 1
	(a, b, c) = map(int, input().split())
	print(a + b + c - 1)


t = int(input())
ans = []
for i in range(t):
	(a, b, c) = [int(x) for x in input().split()]
	num = [a, b, c]
	num.sort()
	d = num[1] + num[2] - num[0]
	ans.append(d)
for i in range(t):
	print(ans[i])


import sys as _sys

def main():
	t = int(input())
	for i_t in range(t):
		(a, b, c) = _read_ints()
		result = find_d(a, b, c)
		print(result)

def _read_line():
	result = _sys.stdin.readline()
	assert result[-1] == '\n'
	return result[:-1]

def _read_ints():
	return map(int, _read_line().split())

def find_d(a, b, c):
	assert isinstance(a, int) and isinstance(b, int) and isinstance(c, int)
	(a, b, c) = sorted((a, b, c))
	if c <= a + b:
		result = 1
	else:
		result = c - (a + b) + 1
	return result
main()


a = int(input())
i = 0
while i < a:
	str1 = input()
	p = str1.split()
	b = int(p[0])
	c = int(p[1])
	d = int(p[2])
	l = [b, c, d]
	x = max(l) + 1
	print(x)
	i = i + 1


T = int(input())
while T > 0:
	arr = list(map(int, input().split()))
	arr.sort()
	(a, b, c) = (arr[0], arr[1], arr[2])
	if a + b < c:
		print(c - a - b + 1)
	else:
		print(a)
	T -= 1


import os
import sys
from io import BytesIO, IOBase
import math
from decimal import *
getcontext().prec = 25
MOD = pow(10, 9) + 7
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')
n = int(input())
for i in range(n):
	l = list(map(int, input().split(' ')))
	print(max(l) + 1)


for _ in range(int(input())):
	(a, b, c) = map(int, input().strip().split())
	d = a ** 2 + b ** 2
	d = d + c ** 2
	print(int(d ** 0.5))


import random
for _ in range(int(input())):
	li = list(map(int, input().strip().split()))
	print(max(li))


from functools import lru_cache
from sys import stdin, stdout
import sys
from math import *
input = stdin.readline
for __ in range(int(input())):
	ar = list(map(int, input().split()))
	ar.sort()
	(a, b, c) = (ar[0], ar[1], ar[2])
	d = ceil(sqrt((c - a) ** 2 + b ** 2))
	print(d)


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


from math import *
import threading
import sys

def fact(x):
	if x == 0:
		return 1
	else:
		return x * fact(x - 1)

def lower_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] >= num:
			answer = middle
			end = middle - 1
		else:
			start = middle + 1
	return answer

def upper_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] <= num:
			answer = middle
			start = middle + 1
		else:
			end = middle - 1
	return answer

def abs(x):
	return x if x >= 0 else -x

def binary_search(li, val, lb, ub):
	ans = -1
	while lb <= ub:
		mid = (lb + ub) // 2
		if li[mid] > val:
			ub = mid - 1
		elif val > li[mid]:
			lb = mid + 1
		else:
			ans = mid
			break
	return ans

def kadane(x):
	sum_so_far = 0
	current_sum = 0
	for i in x:
		current_sum += i
		if current_sum < 0:
			current_sum = 0
		else:
			sum_so_far = max(sum_so_far, current_sum)
	return sum_so_far

def pref(li):
	pref_sum = [0]
	for i in li:
		pref_sum.append(pref_sum[-1] + i)
	return pref_sum

def graph(n, m):
	adj = dict()
	for i in range(1, n + 1):
		adj.setdefault(i, 0)
	for i in range(m):
		(a, b) = map(int, input().split())
		adj[a] += 1
		adj[b] += 1
	return adj

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	li = []
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	for p in range(2, len(prime)):
		if prime[p]:
			li.append(p)
	return li
INF = 1000000000.0
primes = SieveOfEratosthenes(1300000)

def fn(n):
	i = 2
	res = n - 1
	val = 0
	for i in range(int(sqrt(n)) + 1, 1, -1):
		val = i - 1 + int(ceil((n - i) / i))
		if val <= res:
			res = val
		else:
			break
	return res

def solve(a, b, c):
	dis = b ** 2 - 4 * a * c
	ans1 = (-b - sqrt(dis)) / (2 * a)
	print(int(ans1))
	return
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	print(a + b + c - 1)


import math

class Solution:

	def __init__(self):
		pass

	def run(self):
		(a, b, c) = [int(x) for x in input().split()]
		x1 = 0
		y1 = 0
		mn = min(a, b, c)
		return sum([a, b, c]) - mn
t = int(input())
s = Solution()
for i in range(t):
	print(s.run())


t = int(input())
for _ in range(t):
	a = list(map(int, input().split()))
	a.sort()
	x = sum(a) - 1
	y = abs(a[0] + a[1] - a[2] + 1)
	print(int((x + y) / 2))


fast = lambda : stdin.readline().strip()
zzz = lambda : [int(i) for i in fast().split()]
(z, zz) = (input, lambda : list(map(int, z().split())))
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from re import *
from sys import *
from math import *
from heapq import *
from queue import *
from bisect import *
from string import *
from itertools import *
from collections import *
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from collections import Counter as cc
from itertools import accumulate as ac

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

def output(answer):
	stdout.write(str(answer))
num = int(z())
for _ in range(num):
	arr = szzz()
	print(arr[2])


import sys
from collections import defaultdict
t = int(input())
for i in range(t):
	a = list(map(int, input().split()))
	a.sort()
	p = a[0] + a[1] - 1
	q = p + a[2] - 1
	print(q)


import math
from collections import deque
from collections import defaultdict
t = int(input())
while t > 0:
	t -= 1
	(a, b, c) = map(int, input().strip().split(' '))
	arr = [a, b, c]
	arr.sort()
	(x, y, z) = arr
	d = ((z - x) * (z - x) + y * y) ** 0.5
	e = ((y - x) * (y - x) + z * z) ** 0.5
	if int(d) * int(d) == int(d * d):
		print(int(d))
	else:
		print(int(e))


for _ in range(int(input())):
	a = [int(x) for x in input().split()]
	print(max(a))


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


import sys
import os
from math import sqrt, log, log2, log10, gcd, floor, pow, sin, cos, tan, pi, inf, factorial
from copy import copy, deepcopy
from sys import exit, stdin, stdout
from collections import Counter, defaultdict, deque
from itertools import permutations
import heapq
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
mod = 1000000007
iinp = lambda : int(sys.stdin.readline())
inp = lambda : sys.stdin.readline().strip()
strl = lambda : list(inp().strip().split(' '))
intl = lambda : list(map(int, inp().split(' ')))
mint = lambda : map(int, inp().split())
flol = lambda : list(map(float, inp().split(' ')))
flush = lambda : stdout.flush()

def permute(nums):

	def fun(arr, nums, cur, v):
		if len(cur) == len(nums):
			arr.append(cur.copy())
		i = 0
		while i < len(nums):
			if v[i]:
				i += 1
				continue
			else:
				cur.append(nums[i])
				v[i] = 1
				fun(arr, nums, cur, v)
				cur.pop()
				v[i] = 0
				i += 1
		return arr
	res = []
	nums.sort()
	v = [0] * len(nums)
	return fun(res, nums, [], v)

def subsets(res, index, arr, cur):
	res.append(cur.copy())
	for i in range(index, len(arr)):
		cur.append(arr[i])
		subsets(res, i + 1, arr, cur)
		cur.pop()
	return res

def sieve(N):
	root = int(sqrt(N))
	primes = [1] * (N + 1)
	(primes[0], primes[1]) = (0, 0)
	for i in range(2, root + 1):
		if primes[i]:
			for j in range(i * i, N + 1, i):
				primes[j] = 0
	return primes

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

def bs2(arr, l, r, x):
	if x < arr[0] or x > arr[len(arr) - 1]:
		return -1
	while l <= r:
		mid = l + (r - l) // 2
		if arr[mid] == x:
			return mid
		elif arr[mid] < x:
			l = mid + 1
		else:
			r = mid - 1
	return -1

def bs(arr, l, r, x):
	if x < arr[0]:
		return -1
	if x > arr[len(arr) - 1]:
		return len(arr)
	while l <= r:
		mid = l + (r - l) // 2
		if arr[mid] <= x:
			l = mid + 1
		elif arr[mid] > x:
			r = mid - 1
	pos = l
	while pos < len(arr) and arr[pos] <= x:
		pos += 1
	return pos

def solve():
	arr = intl()
	arr.sort()
	a = arr[0]
	b = arr[1]
	c = arr[2]
	if c - a == 0:
		print(b)
	else:
		p = c - a
		h = sqrt(b * b + p * p)
		print(int(h) + 1)
for _ in range(iinp()):
	solve()


import math
t = int(input())
for case in range(t):
	(a, b, c) = [int(x) for x in input().split(' ')]
	ans = math.ceil((c ** 2 + (max(a, b) - min(a, b)) ** 2) ** 0.5)
	print(ans)


import math
for j in range(int(input())):
	l = list(map(int, input().split()))
	print(round(math.sqrt(l[0] ** 2 + l[1] ** 2 + l[2] ** 2)))


import math
for i in range(int(input())):
	s = list(map(int, input().split()))
	s.sort()
	a = s[0]
	b = s[1]
	c = s[2]
	m = (c - a) * (c - a)
	n = b * b
	t = math.sqrt(m + n)
	x = math.floor(t)
	print(x)


import math
n = int(input())
for i in range(n):
	(a, b, c) = input().split()
	(a, b, c) = (int(a), int(b), int(c))
	p = abs(a - c)
	d = math.ceil(math.sqrt(b * b + p * p))
	print(d)


T = int(input())
ans_ls = [0] * T
for t in range(T):
	(a, b, c) = list(map(int, input().split()))
	ans_ls[t] = a + b + c - 1
for ans in ans_ls:
	print(ans)


def getLength(sides):
	sides = list(sorted(sides))
	return sum(sides)
for i in range(int(input())):
	print(sum(map(int, input().split())) - 1)


f = lambda : map(int, input().split())
for _ in range(int(input())):
	(a, b, c) = f()
	print(max(a, b, c) + min(a, b, c))


def prime(a):
	if a < 0:
		a *= -1
	if a < 2:
		return 0
	if a == 2:
		return 1
	if a % 2 == 0:
		return 0
	curr = 3
	while curr * curr <= a:
		if a % curr == 0:
			return 0
		curr += 1
	return 1

def circular_prime(a):
	b = str(a)
	for i in range(0, len(b)):
		left = b[0:i]
		right = b[i:]
		right += left
		c = int(right)
		if not prime(c):
			return False
	return True

def digit_cancel(a, b):
	c = str(a)
	d = str(b)

def pandigital(a):
	curr = 1
	while curr * curr <= a:
		if a % curr == 0:
			ano = a // curr
			c1 = curr
			c2 = ano
			c3 = a
			l = []
			for i in range(0, 10):
				l.append(0)
			while c1 != 0:
				l[c1 % 10] += 1
				c1 //= 10
			while c2 != 0:
				l[c2 % 10] += 1
				c2 //= 10
			while c3 != 0:
				l[c3 % 10] += 1
				c3 //= 10
			fp = True
			for i in range(1, 10):
				if l[i] != 1:
					fp = False
			if l[0] != 0:
				fp = False
			if fp:
				return True
		curr += 1
	return False

def digit_cancell():
	numerator = []
	denominator = []

def fun(i, j):
	res = ''
	for k in range(1, j + 1):
		res += str(i * k)
	return res

def truncable():
	curr = 1

def solve():
	a = input()
	l = a.split(' ')
	(b, c, d) = (int(l[0]), int(l[1]), int(l[2]))
	print(b + c + d - 1)

def main():
	t = int(input())
	while t > 0:
		t -= 1
		solve()
main()


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


(z, zz) = (input, lambda : list(map(int, z().split())))
zzz = lambda : [int(i) for i in stdin.readline().split()]
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from string import *
from re import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from itertools import accumulate as ac

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

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0 and x != 2 or x == 0:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = True
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)
num = 1
num = int(z())
for _ in range(num):
	(a, b, c) = szzz()
	print(c)


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


t = int(input())
for i in range(t):
	a1 = list(map(int, input().strip().split(' ')))
	a = a1[0]
	b = a1[1]
	c = a1[2]
	ans = a + b + c
	a1.sort(reverse=True)
	p = a1[0]
	print(p)


import math
test = int(input())
for _ in range(test):
	(a, b, c) = map(int, input().split())
	diff = abs(a - c)
	if diff > 0:
		d = math.ceil(math.sqrt(diff * diff + b * b))
	else:
		d = b
	print(d)


test_cases = int(input())
for t in range(test_cases):
	nums = list(map(int, input().split()))
	print(sum(nums) - 1)


import sys
import random

def swap(x, y, a):
	temp = a[x]
	a[x] = a[y]
	a[y] = temp
	return a

def solve():
	return None

def main():
	q = []
	for line in sys.stdin.readlines():
		q.append(line)
	for i in range(len(q)):
		q[i] = q[i].rstrip().split(' ')
		q[i] = [int(x) for x in q[i]]
	for i in range(1, len(q)):
		a = q[i][0]
		b = q[i][1]
		c = q[i][2]
		temp = [a, b, c]
		temp.sort()
		if temp[2] > temp[1] + temp[0]:
			print(temp[2] - temp[1] - temp[0] + 1)
		else:
			print(1)
main()


import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy
ORDA = 97

def ii():
	return int(input())

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

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

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

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=2):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	new_number = 0
	while number > 0:
		new_number += number % base
		number //= base
	return new_number

def cdiv(n, k):
	return n // k + (n % k != 0)

def ispal(s):
	for i in range(len(s) // 2 + 1):
		if s[i] != s[-i - 1]:
			return False
	return True
for _ in range(ii()):
	a = sorted(li())
	print(a[-1])


for _ in range(int(input())):
	l = map(int, input().split(' '))
	print(sum(l) - 1)


import sys, math, collections
from collections import defaultdict

def file():
	sys.stdin = open('input.py', 'r')
	sys.stdout = open('output.py', 'w')

def get_array():
	l = list(map(int, input().split()))
	return l

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

def sod(n):
	(n, c) = (str(n), 0)
	for i in n:
		c += int(i)
	return c

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def getFloor(A, x):
	(left, right) = (0, len(A) - 1)
	floor = -1
	while left <= right:
		mid = (left + right) // 2
		if A[mid] == x:
			return A[mid]
		elif x < A[mid]:
			right = mid - 1
		else:
			floor = A[mid]
			left = mid + 1
	return floor

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

def chk_power_of_2(n):
	return n & n - 1 == 0

def main():
	for tt in range(int(input())):
		(a, b, c) = get_ints()
		print(a + b + c - min(a, b, c) - min(a, b, c))
main()


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	(a, b, c) = sorted([a, b, c], reverse=True)
	print(round((a ** 2 + b ** 2 - c ** 2) ** 0.5 + 0.5))


import sys
import math
input = sys.stdin.readline

def solve():
	(a, b, c) = map(int, input().split())
	length = abs(a - c)
	return int(math.sqrt(length ** 2 + b ** 2))
for t in range(int(input())):
	print('{0}'.format(solve()))


from sys import stdin
input = stdin.readline

def A():
	t = int(input())
	for _ in range(t):
		l = list(map(int, input().split()))
		l.sort()
		x = l[2] - l[1] - l[0]
		x = max(x, 0) + 1
		print(x)

def B():
	t = int(input())
	for _ in range(t):
		print(1)

def C():
	t = int(input())
	for _ in range(t):
		print(1)

def D():
	t = int(input())
	for _ in range(t):
		print(1)
A()


for _ in range(int(input())):
	(a, b, c) = sorted([int(x) for x in input().split()])
	print(c + 1)


import math
for _ in range(int(input())):
	l = list(map(int, input().split()))

	def solve():
		l.sort()
		(a, b, c) = l
		return math.ceil(math.sqrt(b * b) + math.sqrt((b - c) ** 2))
	print(solve())


import sys
import math as m
_t = input()
t = int(_t)
while t:
	t -= 1
	n = input().split()
	a = int(n[0])
	b = int(n[1])
	c = int(n[2])
	ans = int(m.sqrt((a - c) ** 2 + b ** 2))
	print(ans)


for _ in ' ' * int(input()):
	(a, b, c) = map(int, input().split())
	print(max(a, b, c))


t = int(input())
while t > 0:
	t -= 1
	l = list(map(int, input().split()))
	l = sorted(l)
	if l[0] == l[1] and l[1] == l[2]:
		print(l[0])
	elif l[0] == l[1]:
		print(l[2])
	elif l[1] == l[2]:
		print(l[0])
	elif l[0] == l[2]:
		print(l[1])
	else:
		c = l[2]
		print(c + 1)


import sys
input = sys.stdin.buffer.readline
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	print(max(a, b, c))


import math
for i in range(int(input())):
	lst = list(map(int, input().split()))
	lst.sort()
	hypsquare = min(lst) * min(lst) + max(lst) * max(lst)
	g = math.sqrt(hypsquare - lst[1] * lst[1])
	print(int(g))


test = int(input())
while test:
	(a, b, c) = [int(x) for x in input().split()]
	mini = a + b + c - 1
	print(mini)
	test -= 1


from sys import stdin, stdout
import heapq
import cProfile
from collections import Counter, defaultdict, deque
from functools import reduce
import math
import threading
import sys
import time

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

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

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

def solve():
	(a, b, c) = get_tuple()
	print(max(a, b, c) + 1)

def main():
	solve()
TestCases = True
if TestCases:
	for i in range(get_int()):
		main()
else:
	main()


import sys
from math import ceil
input = sys.stdin.readline
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	(a, b, c) = sorted([a, b, c])
	x = ((c - a) ** 2 + b ** 2) ** 0.5
	print(ceil(x))


import io
import os
from collections import Counter, defaultdict, deque

def solve(A, B, C):
	arr = [A, B, C]
	arr.sort()
	return arr[2]
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
TC = int(input())
for tc in range(1, TC + 1):
	(A, B, C) = [int(x) for x in input().split()]
	ans = solve(A, B, C)
	print(ans)


from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush, heappop, heapify
import math
from collections import *
from functools import reduce, cmp_to_key
import sys
input = sys.stdin.readline
from itertools import accumulate
from functools import lru_cache
M = mod = 998244353

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

def inv_mod(n):
	return pow(n, mod - 2, mod)

def li():
	return [int(i) for i in input().rstrip('\n').split()]

def st():
	return input().rstrip('\n')

def val():
	return int(input().rstrip('\n'))

def li2():
	return [i for i in input().rstrip('\n')]

def li3():
	return [int(i) for i in input().rstrip('\n')]
for _ in range(val()):
	(a, b, c) = sorted(li())
	print(c + 1)


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

def ii():
	return int(input())

def si():
	return input()

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

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(1000000)
	threading.stack_size(1024000)
	thread = threading.Thread(target=main)
	thread.start()
import sys
input = sys.stdin.readline
scanner = lambda : int(input())
string = lambda : input().rstrip()
get_list = lambda : list(read())
read = lambda : map(int, input().split())
get_float = lambda : map(float, input().split())

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def factorial(x, m):
	val = 1
	while x > 0:
		val = val * x % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

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

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

def is_integer(n):
	return math.ceil(n) == math.floor(n)

def nCr(n, k):
	if k > n:
		return 0
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	(prime[0], prime[1]) = (False, False)
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def phi(n):
	result = n
	p = 2
	while p * p <= n:
		if n % p == 0:
			while n % p == 0:
				n = n // p
			result = result * (1.0 - 1.0 / float(p))
		p = p + 1
	if n > 1:
		result = result * (1.0 - 1.0 / float(n))
	return int(result)

def is_prime(n):
	if n == 0:
		return False
	if n == 1:
		return True
	for i in range(2, int(n ** (1 / 2)) + 1):
		if not n % i:
			return False
	return True

def next_prime(n, primes):
	while primes[n] != True:
		n += 1
	return n
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]

def factoriazation(x):
	res = []
	for i in range(2, int(x ** 0.5) + 1):
		while x % i == 0:
			res.append(i)
			x //= i
	if x != 1:
		res.append(x)
	return res

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

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

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()

def binary_search(low, high, w, h, n):
	while low < high:
		mid = low + (high - low) // 2
		if check(mid, w, h, n):
			low = mid + 1
		else:
			high = mid
	return low

def check(moves, n):
	val = (moves + 1) // 2
	rem = moves - val
	sol = (val + 1) * (rem + 1)
	return sol < n

def sortSecond(val):
	return val[1]
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
alphs = 'abcdefghijklmnopqrstuvwxyz'
from itertools import permutations
import math
import bisect as bis
import random
import sys
import collections as collect
import functools as fnt

def solve():
	(a, b, c) = read()
	print(a + b + c - 1)
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')
t = scanner()
for i in range(t):
	solve()


def Polygon():
	lst = list(map(int, input().split()))
	a = lst[0]
	b = lst[1]
	c = lst[2]
	d = round((abs(a - c) ** 2 + b ** 2) ** 0.5)
	ans.append(d)
	lst = []
n = int(input())
ans = []
for i in range(n):
	Polygon()
for i in range(n):
	print(ans[i])


import sys
input = sys.stdin.readline

def solve():
	a = list(map(int, input().split()))
	print(sum(a) - 1)
t = int(input())
for _ in range(t):
	solve()


import sys
infile = sys.stdin
next(infile)
for line in infile:
	l = list(map(int, line.split()))
	sum = l[0] + l[1] + l[2]
	print(sum - 2)


for _ in range(int(input())):
	(a, b, c) = [int(x) for x in input().split()]
	print(int((b ** 2 + (a - c) ** 2) ** 0.5))


f = int(input())
for x in range(f):
	(a, b, c) = map(int, input().split())
	if a > b:
		print(int(((a - b) ** 2 + c ** 2) ** 0.5) + 1)
	elif a < b:
		print(int(((b - a) ** 2 + c ** 2) ** 0.5) + 1)
	else:
		print(c)


import sys
import math
input = sys.stdin.readline
tests = int(input())
for case in range(tests):
	(a, b, c) = map(int, input().split())
	print(max(a, b, c))


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


from collections import Counter, OrderedDict
from itertools import permutations as perm
from collections import deque
from sys import stdin
from bisect import *
from heapq import *
import math
g = lambda : stdin.readline().strip()
gl = lambda : g().split()
gil = lambda : [int(var) for var in gl()]
gfl = lambda : [float(var) for var in gl()]
gcl = lambda : list(g())
gbs = lambda : [int(var) for var in g()]
mod = int(1000000000.0) + 7
inf = float('inf')
(t,) = gil()
for _ in range(t):
	(a, b, c) = gil()
	d = abs(a - c)
	print(math.ceil(math.sqrt(d ** 2 + b ** 2)))


t = int(input())
for _ in range(t):
	a = list(map(int, input().split()))
	ans = max(1, 2 * max(a) - sum(a) + 1)
	print(ans)


def solve():
	(a, b, c) = map(int, input().split())
	if a == 1 and b == 1 and (c == 1):
		print(1)
		return
	print(max(a, b, c) + 1)
for _ in range(int(input())):
	solve()


t = int(input())
for _ in range(t):
	ip = [int(n) for n in input().split()]
	print(sum(ip) - 1)


t = int(input())
for i in range(t):
	(x, y, z) = map(int, input().split())
	print(x + y + z - 2)


import math
t = int(input())
for _ in range(t):
	arr = list(map(int, input().split()))
	arr.sort()
	x = arr[0]
	y = arr[1]
	z = arr[2]
	ans = math.ceil(math.sqrt((z - y) ** 2 + x ** 2))
	print(ans)


def fence(aa):
	if max(aa) - min(aa) == 0:
		return max(aa) + min(aa)
	return max(aa) - min(aa)
tc = int(input())
for i in range(tc):
	aa = list(map(int, input().split()))
	print(fence(aa))


t = int(input())
for _ in range(t):
	a = [int(s) for s in input().split()]
	d = max(a)
	print(d)


T = int(input())
while T != 0:
	v = [int(i) for i in input().split()]
	print(sum(v) - 1)
	T -= 1


import math as m
t = int(input())
for i in range(t):
	(a, b, c) = [int(x) for x in input().split()]
	ans = m.ceil((a ** 2 + abs(b - c) ** 2) ** (1 / 2))
	print(ans)


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


t = int(input())
for i in range(t):
	(a, b, c) = sorted(list(map(int, input().split())))
	ans = a ** 2 + (c - b) ** 2
	print(int(ans ** 0.5))


import math
n = int(input())
while n > 0:
	n -= 1
	(a, b, c) = map(int, input().split())
	print(a + b + c - 1)


import math
t = int(input())
while t != 0:
	(a, b, c) = map(int, input().split())
	d = abs(c - b)
	ans = math.sqrt(d * d + a * a)
	print(math.ceil(ans))
	t = t - 1


t = int(input())
w = []
for i in range(t):
	r = list(map(int, input().split()))
	w.append(sum(r) - 1)
for i in w:
	print(i)


T = int(input())
for case in range(T):
	(a, b, c) = map(int, input().split())
	print(max({a, b, c}))


import math
t = int(input())
for _ in range(t):
	sides = list(map(int, input().split()))
	sides.sort()
	(a, b, c) = sides
	d_high = a + b + c
	print(d_high - 1)


for _ in range(int(input())):
	(n, k, m) = map(int, input().split())
	s = n + k + m
	print(s - 1)


n = int(input())
for _ in range(n):
	(a, b, c) = map(int, input().split())
	ans = b * b + (a - c) ** 2
	ans = int(pow(ans, 0.5)) + 1
	print(ans)


for _ in range(int(input())):
	(a, b, c) = [int(x) for x in input().split()]
	m = max(a, b, c)
	if m == c:
		print(int((m ** 2 + (a - b) ** 2) ** 0.5) + 1)
	elif m == a:
		print(int((a ** 2 + (c - b) ** 2) ** 0.5) + 1)
	else:
		print(int((b ** 2 + (a - c) ** 2) ** 0.5) + 1)


from sys import stdin, stdout
from collections import defaultdict as dd
from math import sqrt, log
for t in range(int(input())):
	(a, b, c) = map(int, input().split())
	print(a + b + c - 1)


import math

def solve(arr):
	return sum(arr) - 1
	pass
t = int(input())
ans = []
for i in range(t):
	arr = [int(x) for x in input().split()]
	ans.append(solve(arr))
for test in ans:
	print(test)


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


exec(int(input()) * 'print(sum(map(int,input().split()))-1);')


try:
	for _ in range(int(input())):
		(a, b, c) = list(map(int, input().split()))
		if abs(a - b) == abs(b - c) == abs(c - a):
			print(max(a, b, c) + abs(a - b))
			continue
		else:
			print(max(a, b, c) + min(abs(a - b), abs(b - c), abs(c - a)))
except:
	pass


import sys
import random
from fractions import Fraction
from math import *

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

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

def finput():
	return float(input())

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

def linput():
	return list(input())

def rinput():
	return map(int, tinput())

def fiinput():
	return map(float, tinput())

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

def trinput():
	return tuple(rinput())

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

def NOYES(fl):
	if fl:
		print('NO')
	else:
		print('YES')

def YESNO(fl):
	if fl:
		print('YES')
	else:
		print('NO')

def main():
	q = srlinput()
	if q[-1] > q[0] + q[1]:
		print(q[-1] - q[0] - q[1] + 1)
	else:
		print(1)
for i in range(iinput()):
	main()


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

def read_int():
	return int(input())
for _ in range(read_int()):
	print(sum(read_ints()) - 1)


tt = int(input())
for i in range(tt):
	(A, B, C) = map(int, input().split())
	print(A + B + C - 1)


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


import sys
import math
mod = 998244353
dynamic_factorial = False

def main(test_case=False):
	n = int(input()) if test_case else 1
	for _ in range(n):
		test()
		print()

def fast_pow(a: int, b: int):
	res = 1
	while b > 0:
		if b & 1:
			res *= a
		a *= a
		b >>= 1
	return res

def c2(n):
	return n * (n - 1) // 2

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

def bits(n: int):
	return list(bin(n)).count('1')

def flush():
	sys.stdout.flush()

def parr(arr):
	print(*arr, sep=' ')

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

def ext_gcd(a: int, b: int):
	if b == 0:
		return [a, [1, 0]]
	res = ext_gcd(b, a % b)
	g = res[0]
	if g != 1:
		return False
	x1 = res[1][0]
	y1 = res[1][1]
	x = y1
	y = x1 - y1 * (a // b)
	return [g, [x, y]]

def get_set(a):
	res = {}
	for x in a:
		if x in res:
			res[x] += 1
		else:
			res[x] = 1
	return res
fact = {0: 1}

def factorial(n):
	if dynamic_factorial:
		if n not in fact:
			fact[n] = factorial(n - 1) * n
		return fact[n]
	else:
		res = 1
		while n > 0:
			res = res * n % mod
			n -= 1
		return res

def sum_of(a):
	res = 0
	for x in a:
		res = (res + x) % mod
	return res

def prod_of(a):
	res = 1
	for x in a:
		res = res * x % mod
	return res

def different_elements(arr):
	ans = 0
	n = len(arr)
	i = 0
	while i < n:
		ans += 1
		while i < n - 1 and arr[i] == arr[i + 1]:
			i += 1
		i += 1
	return ans

def test():
	a = get()
	print(sum(a) - 1)
main(test_case=True)


for _ in range(int(input())):
	L = sorted(list(map(int, input().split())))
	if L[0] + L[1] >= L[2]:
		print(1)
	else:
		print(L[2] - L[0] - L[1] + 1)


from sys import stdin

def iinput():
	return int(stdin.readline())

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

def linput():
	return list(map(int, stdin.readline().split()))
t = iinput()
while t:
	t -= 1
	(a, b, c) = minput()
	print(max(a, b, c))


for _ in range(int(input())):
	A = list((int(x) for x in input().split()))
	A.sort()
	(a, b, c) = (A[0], A[1], A[2])
	d = int((b ** 2 + (c - a) ** 2) ** 0.5)
	print(d)


import math
cases = int(input())
for t in range(cases):
	(a, b, c) = list(map(int, input().split()))
	(a, b, c) = sorted([a, b, c])
	l1 = a
	l2 = c - b
	v = math.ceil((l1 ** 2 + l2 ** 2) ** 0.5)
	print(v)


t = int(input())
while t > 0:
	sides = list(map(int, input().split()))
	print(max(sides[0], sides[1], sides[2]))
	t -= 1


from math import sqrt
t = int(input())
while t:
	a = sorted(list(map(int, input().split())))
	print(int(sqrt(a[0] ** 2 + a[1] ** 2) + a[2] - 1))
	t -= 1


n_cases = int(input())
for c in range(n_cases):
	(a, b, c) = [int(s) for s in input().split()]
	print(a + b + c - 1)


from collections import defaultdict
t = int(input())
for _ in range(t):
	(a, b, c) = [int(x) for x in input().split()]
	print(max(a, b, c) + 1)


test = int(input())
j = 1
while j <= test:
	a = [int(a) for a in input().split()]
	a.sort()
	print(a[0] + a[2] - a[1])
	j = j + 1


import sys
t = int(input())
while t > 0:
	t -= 1
	input = sys.stdin.readline()
	(a, b, c) = map(int, input.split())
	if a == b == c:
		print(a)
	elif a == b or a == c or c == b:
		if a == b:
			print(c)
		elif b == c:
			print(a)
		else:
			print(b)
	else:
		x = max(a, b, c)
		y = min(a, b, c)
		print(x - y)


import sys
import os
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')
mod = 10 ** 9 + 7

def lcm(x, y):
	return x * y / gcd(x, y)

def fact(x, mod=mod):
	ans = 1
	for i in range(1, x + 1):
		ans = ans * i % mod
	return ans

def arr2D(n, m, default=0):
	lst = []
	for i in range(n):
		temp = [default] * m
		lst.append(temp)
	return lst

def sortDictV(x):
	return {k: v for (k, v) in sorted(x.items(), key=lambda item: item[1])}

def solve(lst):
	return max(lst) + 1
for _ in range(int(input())):
	lst = list(map(int, input().split()))
	print(solve(lst))


from sys import stdin, stdout
import math
from itertools import permutations, combinations
from collections import defaultdict
from collections import Counter
from bisect import bisect_left
import sys
from queue import PriorityQueue
import operator as op
from functools import reduce
mod = 1000000007

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

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

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

def printIn(ob):
	return stdout.write(str(ob) + '\n')

def powerLL(n, p):
	result = 1
	while p:
		if p & 1:
			result = result * n % mod
		p = int(p / 2)
		n = n * n % mod
	return result

def solve_linear(equation, var='x'):
	expression = equation.replace('=', '-(') + ')'
	grouped = eval(expression.replace(var, '1j'))
	return -grouped.real / grouped.imag

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom

def myCode():
	l = L()
	print(max(l[0], l[1], l[2]))

def main():
	for t in range(I()):
		myCode()
main()


import math
t = int(input())
while t > 0:
	(a, b, c) = map(int, input().split())
	d = math.floor(math.sqrt(math.pow(b, 2) + pow(c - a, 2)))
	print(max(a, b, c))
	t -= 1


a = int(input())
for i in range(a):
	case = input().split()
	case[0] = int(case[0])
	case[1] = int(case[1])
	case[2] = int(case[2])
	case.sort()
	print(case[2])


import math
for t in range(int(input())):
	(a, b, c) = list(map(int, input().split()))
	dist = int(math.sqrt((a - c) ** 2 + b ** 2))
	print(dist)


t = int(input())
for _ in range(t):
	l1 = [int(x) for x in input().split()]
	print(sum(l1) - 1)


import sys
import heapq
import copy
import math
import decimal
input = sys.stdin.readline

def binary_exponentiation(a, b):
	ans = 1
	while b != 0:
		bit = b % 2
		if bit == 1:
			ans = ans * a
		a = a * a
		b = b // 2
	return ans

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

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

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

def insr2():
	s = input()
	s = list(s[:len(s) - 1])
	s = [ord(s[i]) - ord('a') for i in range(len(s))]
	return s

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

def pr_list(a):
	print(*a, sep=' ')

def swap(a, b):
	temp = a
	a = b
	b = temp
	return [a, b]

def pri(a, b):
	s = '? ' + str(a) + ' ' + str(b)
	print(s)
	sys.stdout.flush()
result = []

def nCk(arr, itr, k, n):
	if len(arr) == k:
		result.append(arr)
		return
	if len(arr) > k or itr == n + 1:
		return
	nCk(arr + [itr], itr + 1, k, n)
	nCk(arr, itr + 1, k, n)
	return

def nPk(arr, itr, k, n):
	if len(arr) == k:
		result.append(arr)
		return
	if len(arr) > k or itr == n + 1:
		return
	for i in range(len(arr) + 1):
		nPk(arr[0:i] + [itr] + arr[i:len(arr)], itr + 1, k, n)
	nPk(arr, itr + 1, k, n)
	return

def main():
	tests = inp()
	mod = 1000000007
	limit = 10 ** 18
	ans = 0
	stack = []
	arr = []
	heapq.heapify(arr)
	for test in range(tests):
		[a, b, c] = inlt()
		print(math.ceil(math.sqrt(b * b + (c - a) * (c - a))))
main()


for _ in range(int(input())):
	l = list(map(int, input().split()))
	l.sort()
	a = l[0]
	b = l[1]
	c = l[2]
	f = c - a
	ans = pow(pow(f, 2) + pow(b, 2), 0.5)
	if ans - int(ans) == 0:
		print(int(ans))
	else:
		print(int(ans) + 1)


import math

def solve(a, b, c):
	return math.ceil(math.sqrt(a ** 2 + (b - c) ** 2))
t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	print(solve(a, b, c))


from sys import stdin, stdout

def INPUT():
	return list((int(i) for i in stdin.readline().split()))
import math

def inp():
	return stdin.readline()

def out(x):
	return stdout.write(x)
import math as M
MOD = 10 ** 9 + 7
from random import randint as R
for _ in range(int(input())):
	(a, b, c) = INPUT()
	print(int(math.sqrt((c - a) ** 2 + b ** 2)))


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

def arp(arr):
	return ' '.join([str(i) for i in arr])
from collections import deque, Counter
from math import ceil, sqrt, log2, log, floor
for _ in range(int(input())):
	arr = rl()
	arr.sort()
	print(arr[-1])


from os import path
import sys
from heapq import heappush, heappop
from functools import cmp_to_key as ctk
from collections import deque, defaultdict as dd
from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right
from itertools import permutations
from datetime import datetime
from math import ceil, sqrt, log, gcd

def ii():
	return int(input())

def si():
	return input().rstrip()

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

def li():
	return list(mi())
abc = 'abcdefghijklmnopqrstuvwxyz'
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def bo(i):
	return ord(i) - ord('a')

def ceil(a, b):
	return (a + b - 1) // b
file = 1

def f():
	sys.stdout.flush()

def solve():
	for _ in range(ii()):
		a = li()
		a.sort()
		print(a[-1] + 1)
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
else:
	input = sys.stdin.readline
solve()


t = int(input())
for test in range(t):
	a = [int(i) for i in input().split(' ')]
	print(max(a))


import sys
import math
import collections
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())
t = inp()
for i in range(t):
	l = inlt()
	l.sort()
	a = l[0]
	b = l[1]
	c = l[2]
	print(int(math.sqrt((c - a) * (c - a) + b * b)))


import math

def f(a, b, c):
	return int(math.sqrt(b ** 2 + (a - c) ** 2)) + 1
t = int(input())
for i in range(t):
	(a, b, c) = map(int, input().split())
	print(f(a, b, c))


t = int(input())
for x in range(t):
	nums = input().split()
	a = int(nums[0])
	b = int(nums[1])
	c = int(nums[2])
	d = a + b + c - 1
	print(d)


t = int(input())
while t > 0:
	t = t - 1
	[a, b, c] = input().split()
	a = int(a)
	b = int(b)
	c = int(c)
	print(a + b + c - 1)


t = int(input())
start = 1
while start <= t:
	(a, b, c) = input().split()
	a = int(a)
	b = int(b)
	c = int(c)
	total = a + b + c
	print(total - 1)
	start += 1


import sys
input = sys.stdin.readline
n = int(input())
for i in range(n):
	(a, b, c) = list(map(int, input().split(' ')))
	print(int((a ** 2 + (b - c) ** 2) ** 0.5))


for _ in range(int(input())):
	(p, n, m) = map(int, input().split())
	print(p + n + m - 1)


for i in range(int(input())):
	li = sorted(list(map(int, input().split())))
	if li[2] == 1:
		print(1)
	else:
		print(li[2] - 1)


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


from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	(a, b, c) = list(map(int, stdin.readline().split()))
	print(a + b + c - 2)


[print(sum(map(int, input().split())) - 1) for i in range(int(input()))]


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

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(stdin, stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from os import path
if path.exists('tc.txt'):
	stdin = open('tc.txt', 'r')

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())

def pri(i):
	stdout.write(f'{i}\n')
tc = gi()
while tc:
	tc -= 1
	ar = gari()
	pri(round(sum([i * i for i in ar]) ** 0.5))


t = int(input())
while t:
	t -= 1
	[a, b, c] = [int(i) for i in input().split()]
	print(abs(a + b - c) + 1)


t = int(input())
for _ in range(t):
	(a, b, c) = [int(p) for p in input().split()]
	d = a + b + c - 1
	if d < b:
		d += b - d + 1
	print(d)


t = int(input())
from collections import OrderedDict
for i in range(t):
	l = [int(x) for x in input().split()]
	l.sort()
	if l[0] + l[1] > l[2]:
		print(1)
	else:
		x = l[2] - l[0] - l[1]
		print(x + 1)


t = int(input())
i = 1
while i <= t:
	a = list(map(int, input().split(' ')))
	d = max(a)
	print(d)
	i += 1


t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	if a > b:
		(a, b) = (b, a)
	if b > c:
		(b, c) = (c, b)
	if a > c:
		(a, c) = (c, a)
	print(c)


import sys
import math
from collections import defaultdict, Counter
t = int(input())
for i in range(t):
	(a, b, c) = map(int, input().split())
	print(max(a, b, c) + 1)


import sys
import math

def input():
	return sys.stdin.readline().rstrip()
t = int(input())
for i in range(t):
	[a, b, c] = list(map(int, input().split()))
	d = math.ceil(math.sqrt(a * a + (b - c) * (b - c)))
	print(d)


t = int(input())
for i in range(t):
	k = [int(i) for i in input().split()]
	print(max(k))


for _ in range(int(input())):
	array = list(map(int, input().split()))
	array.sort()
	print(array[2] + 1)


import math
for _ in range(int(input())):
	a = list(map(int, input().split()))
	a.sort()
	if a[-1] == a[-2]:
		print(a[0])
	else:
		print(int(math.sqrt(a[0] ** 2 + abs(a[-1] - a[-2]) ** 2)) + 1)


for i in range(int(input())):
	m = list(map(int, input().split()))
	print(sum(m) - 1)


t = int(input())
for i in range(t):
	(a, b, c) = map(int, input().split())
	print('{}'.format(int(((a - c) ** 2 + b ** 2) ** 0.5)))


from sys import stdin

class Input:

	def __init__(self):
		self.it = iter(stdin.readlines())

	def line(self):
		return next(self.it).strip()

	def array(self, sep=' ', cast=int):
		return list(map(cast, self.line().split(sep=sep)))

def testcases(unknown=False):
	inpt = Input()

	def testcases_decorator(func):
		(cases,) = [0] if unknown else inpt.array()
		while unknown or cases > 0:
			try:
				func(inpt)
				cases -= 1
			except StopIteration:
				break
	return testcases_decorator

@testcases()
def solve(inpt):
	(a, b, c) = inpt.array()
	print(a + b + c - 1)


import sys
import itertools
import math
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
(n,) = I()
while n:
	n -= 1
	arr = sorted(I())
	print(math.ceil(((arr[2] - arr[1]) ** 2 + arr[0] ** 2) ** (1 / 2)))


t = int(input())
while t:
	a = list(map(int, input().split()))
	summ = 0
	for i in a:
		summ += i
	print(summ - 1)
	t -= 1


import sys
ii = lambda : sys.stdin.readline().strip()
idata = lambda : [int(x) for x in ii().split()]

def solve():
	(a, b, c) = idata()
	print(max(a, b, c))
	return
for t in range(int(ii())):
	solve()


import math as mt
t = int(input())
for _ in range(t):
	(a, b, c) = [int(x) for x in input().split()]
	d = a + b + c - 1
	print(d)


import sys
T = int(sys.stdin.readline().strip())
for t in range(0, T):
	(a, b, c) = list(map(int, sys.stdin.readline().strip().split()))
	print(a + b + c - 1)


import math
for _ in range(int(input())):
	a = [int(x) for x in input().split()]
	a.sort()
	x = a[0] * a[0] - a[1] * a[1] + a[2] * a[2]
	z = int(math.sqrt(x))
	print(z)


def solve(a, b, c):
	k = [a, b, c]
	k.sort()
	return k[2]
t = int(input())
while t:
	(a, b, c) = map(int, input().split())
	print(solve(a, b, c))
	t -= 1


t = int(input())
out = []
while t:
	inp = list(map(int, input().split()))
	inp.sort()
	out.append(inp[0] + inp[2] - inp[1])
	t -= 1
for i in out:
	print(i)


import sys
import math
from collections import Counter, defaultdict
LI = lambda : list(map(int, input().split()))
MAP = lambda : map(int, input().split())
IN = lambda : int(input())
S = lambda : input()

def case():
	(a, b, c) = sorted(MAP())
	print(a + b + c - 1)
for _ in range(IN()):
	case()


import math
t = int(input())

def cartLength(p1, p2):
	(x1, y1) = p1
	(x2, y2) = p2
	return round(math.sqrt(abs(x2 - x1) ** 2 + abs(y2 - y1) ** 2))

def findLength(segment):
	(one, two, three) = segment
	p1 = (0, one)
	p2 = (two, three)
	return cartLength(p1, p2)
for _ in range(t):
	segments = [int(i) for i in str(input()).split(' ')]
	print(findLength(segments))


def test():
	a = list(map(int, input().rstrip().split()))
	a.sort()
	print(a[1] + a[2] - 1)
n = int(input())
while n > 0:
	test()
	n -= 1


import math
from sys import stdin
from sys import setrecursionlimit
setrecursionlimit(100000)

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

def check(l, nm, k):
	peop = 0
	sm = 0
	for i in range(len(l)):
		sm += l[i]
		if sm > nm:
			sm = l[i]
			peop += 1
	if sm > 0:
		peop += 1
	if peop <= k:
		return 1
	else:
		return 0

def binarysearch(l, start, end, k):
	mid = (start + end) // 2
	if start > end:
		return 10000000000
	elif check(l, mid, k):
		return min(mid, binarysearch(l, start, mid - 1, k))
	else:
		return binarysearch(l, mid + 1, end, k)

def func(a, b, d):
	ans = 0
	for i in range(d):
		ans += abs(a[i] - b[i])
	return ans
for _ in range(int(input())):
	(a, b, c) = put()
	print(a + b + c - 1)


for item in range(int(input())):
	print(max(map(int, input().split())))


import sys

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

def mint():
	return int(minp())

def mints():
	return map(int, minp().split())

def solve():
	(a, b, c) = sorted(mints())
	print(a + b + c - 1)
for i in range(mint()):
	solve()


for _ in range(int(input())):
	l = list(map(int, input().split()))
	l.sort()
	print(l[2])


t = int(input())
for i in range(t):
	inp = input()
	eingabe = inp.split(' ')
	ausgabe = int(eingabe[0]) + int(eingabe[1]) + int(eingabe[2]) - 1
	print(ausgabe)


testcases = int(input())
for i in range(testcases):
	a = input()
	(a, b, c) = a.split(' ')
	(a, b, c) = (int(a), int(b), int(c))
	print(a + b + c - 2)


t = input()
s = int(t)

def ok():
	l = list(map(int, input().split()))
	l.sort()
	print(l[2] + 1)
while s > 0:
	ok()
	s -= 1


import itertools
import math
import sys
from collections import defaultdict

def stdinWrapper():
	data = '2\n1 2 3\n12 34 56\n'
	for line in data.split('\n'):
		yield line
if '--debug' not in sys.argv:

	def stdinWrapper():
		while True:
			yield sys.stdin.readline()
inputs = stdinWrapper()

def inputWrapper():
	return next(inputs)

def getType(_type):
	return _type(inputWrapper())

def getArray(_type):
	return [_type(x) for x in inputWrapper().split()]

def tuplerize(method):

	def wrap(*args, **kwargs):
		res = method(*args, **kwargs)
		if not isinstance(res, (tuple, list)):
			res = (res,)
		return res
	return wrap

def binary_pow(a, b):
	result = 1
	while b:
		if b % 1:
			result *= a
		a *= a
		b >>= 1
	return result

@tuplerize
def solve(a, b, c):
	return round(math.sqrt((c - a) * (c - a) + b * b))
t = getType(int)
for _ in range(t):
	(a, b, c) = getArray(int)
	res = solve(a, b, c)
	print(*res)


import sys
input = iter(sys.stdin.read().splitlines()).__next__
sys.setrecursionlimit(10000)
TC = int(input())
for tc in range(TC):
	(a, b, c) = map(int, input().split())
	res = max(a, b, c)
	print(res)


import sys
sys.setrecursionlimit(10 ** 5)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.buffer.readline())

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

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

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def BI():
	return sys.stdin.buffer.readline()[:-1]

def SI():
	return sys.stdin.buffer.readline()[:-1].decode()
for _ in range(II()):
	(a, b, c) = MI()
	x = a + b - 1
	d = x + c - 1
	print(d)


t = int(input())
if 1 <= t <= 1000:
	for i in range(t):
		(a, b, c) = map(int, input().split())
		if 1 <= a <= 1000000000 and 1 <= b <= 1000000000 and (1 <= c <= 1000000000):
			if a + b > c:
				print(a + b)
			elif b + c > a:
				print(b + c)
			elif a + c > b:
				print(a + c)


import sys
input = sys.stdin.readline

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

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

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

def invr():
	return map(int, input().split())
t = inp()
for _ in range(t):
	(a, b, c) = invr()
	print(max(a, b, c))


import random
from sys import stdin
input = stdin.readline

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

def lcm(a, b):
	return a * b / gcd(a, b)
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	print(max(a, b, c) + 1)


n = int(input())
for i in range(n):
	li = list(map(int, input().split()))[:3]
	print(min(li) + max(li))


from sys import stdout, stdin
(_input, _print) = (stdin.readline, stdout.write)
(_int, _range) = (int, range)

def solution():
	for _ in _range(_int(_input())):
		(x, y, z) = [_int(i) for i in _input().split()]
		print(x + y + z - 1)
solution()


import os
import sys
from io import BytesIO, IOBase
import threading
from bisect import bisect_right
from math import gcd, log
from collections import defaultdict
from pprint import pprint
from math import ceil
MOD = 10 ** 9 + 7

def main():
	(a, b, c) = map(int, input().split())
	print(a + b + c - 1)
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())):
	main()


t = int(input())
for tc in range(t):
	(a, b, c) = map(int, input().split())
	e = a + b - 1
	d = e + c - 1
	print(d)


import math
test = int(input())
for tt in range(test):
	array = list(map(int, input().split()))
	array.sort()
	x = array[0]
	y = array[1]
	z = array[2]
	answer = math.ceil(math.sqrt((z - y) ** 2 + x ** 2))
	print(answer)


from collections import defaultdict, Counter
from sys import stdin
from math import ceil, floor
input = stdin.readline
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	print(max(a + b, b + c, c + a))


import sys
[t] = [int(i) for i in input().split()]
for _ in range(t):
	[a, b, c] = [int(i) for i in input().split()]
	print(a + b + c - 1)


import sys, io, os, time
from collections import defaultdict
from collections import Counter
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect, math, heapq
alphabet = 'abcdefghijklmnopqrstuvwxyz'
input = sys.stdin.readline
for ii in range(int(input())):
	arr = list(map(int, input().split()))
	arr.sort()
	theta = math.atan((arr[1] - arr[0]) / arr[2])
	print(math.ceil(arr[2] / math.cos(theta)))


T = int(input())
for z in range(T):
	(a, b, c) = [int(x) for x in input().split()]
	l1 = min(a, b, c)
	l3 = max(a, b, c)
	l2 = a + b + c - l1 - l3
	if l1 == l3:
		print(a)
	else:
		o = int(((l1 - l3) ** 2 + l2 ** 2) ** (1 / 2)) + 1
		print(o)


from math import sqrt, ceil
a = int(input())
for i in range(a):
	b = [int(s) for s in input().split()]
	c = max(b)
	b.remove(c)
	print(ceil(sqrt((c - min(b)) ** 2 + max(b) ** 2)))


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


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

def printlist(xs):
	print(' '.join(map(str, xs)))
T = int(input())
while T:
	T -= 1
	abc = list(readis())
	print(min(abc) + max(abc))


from collections import Counter
import string
import math
import sys

def array_int():
	return [int(i) for i in sys.stdin.readline().split()]

def vary(number_of_variables):
	if number_of_variables == 1:
		return int(sys.stdin.readline())
	if number_of_variables >= 2:
		return map(int, sys.stdin.readline().split())

def makedict(var):
	return dict(Counter(var))
mod = 1000000007
for _ in range(vary(1)):
	(a, b, c) = vary(3)
	print(math.ceil(b + math.sqrt(abs(pow(c, 2) - pow(a, 2)))))


import sys
import collections
import math
import bisect
import heapq
inf = sys.maxsize

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

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

def input():
	return sys.stdin.readline().strip()
mod = 1000000007
for _ in range(int(input())):
	(a, b, c) = sorted(get_ints())
	print(c + 1)


for i in [0] * int(input()):
	print(sum(map(int, input().split())) - 1)


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


for _ in range(int(input())):
	a = list(map(int, input().split()))
	if len(set(a)) < len(a):
		print(max(a))
	else:
		print(max(a) - min(a))


import sys
input = iter(sys.stdin.read().splitlines()).__next__
t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	print(a + b + c - 1)


import sys

def In():
	return sys.stdin.readline()

def Out(x):
	return sys.stdout.write(str(x) + '\n')
t = int(In())
for i in range(t):
	(a, b, c) = map(int, In().split())
	m = max(a - b - c, b - a - c, c - a - b)
	n = a + b + c
	ans = max(m + 1, 1, n - 1)
	Out(ans)


MOD = 1000000007
from collections import defaultdict as dd, Counter, deque

def si():
	return input()

def ii():
	return int(input())

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

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

def out(v):
	print(v)

def spout():
	print(v, end=' ')

def d2b(n):
	return bin(n).replace('0b', '')

def twod(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def vow():
	return ['a', 'e', 'i', 'o', 'u']

def let():
	return [chr(i) for i in range(97, 123)]

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def ispow2(x):
	return x and (not x & x - 1)

def prime_factors(n):
	i = 2
	factors = []
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n //= i
			factors.append(i)
	if n > 1:
		factors.append(n)
	return list(factors)
t = ii()
while t:
	t -= 1
	(a, b, c) = mi()
	print(a + b + c - 1)


import math

def get_int():
	return int(input())

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

def get_char_list():
	return list(input())
cases = get_int()
for _ in range(cases):
	(a, b, c) = get_int_list()
	print(a + b + c - 1)


for x in range(int(input())):
	(a, b, c) = list(map(int, input().split()))
	m = max(a, b, c)
	n = min(a, b, c)
	print(a + b + c - 1)


t = int(input())
res = []
for i in range(t):
	(a, b, c) = map(int, input().split())
	k = a + b - 1
	ans = c + k - 1
	res.append(ans)
for r in res:
	print(r)


from math import sqrt, ceil
for i in range(int(input())):
	(a, b, c) = map(int, input().split())
	m = max(a, b, c)
	anot = a + b + c - m
	print(ceil(sqrt(m * m + anot * anot) - 1))


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


import math
for _ in range(int(input())):
	lis = sorted(map(int, input().split()))
	ans = math.ceil(math.sqrt((lis[2] - lis[1]) ** 2 + lis[0] ** 2))
	print(ans)


import sys, math
input = sys.stdin.readline

def inInt():
	return int(input())

def inStr():
	return input().strip('\n')

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

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

def bsearch(nums, target):
	N = len(nums or [])
	l = 0
	r = N - 1
	while l <= r:
		mid = (l + r) // 2
		if nums[mid] < target:
			l = mid + 1
		elif nums[mid] > target:
			r = mid - 1
		else:
			return (None, mid, None)
	return (r if r >= 0 else None, None, l if l <= N - 1 else None)

def yesOrNo(val):
	print('YES' if val else 'NO')

def printSpacedArray(nums):
	print(*nums)

def solve():
	abc = inIList()
	print(int(math.sqrt((abc[2] - abc[1]) * (abc[2] - abc[1]) + abc[0] * abc[0])))
tests = inInt()
for case in range(tests):
	solve()


a = int(input())
for i in range(a):
	case = input().split()
	case[0] = int(case[0])
	case[1] = int(case[1])
	case[2] = int(case[2])
	case.sort()
	a = case[2] - case[0] - case[1] + 1
	b = int((case[0] + case[1] + case[2]) / 3)
	if a > 0:
		print(a)
	else:
		print(b)


from math import sqrt
for _ in range(int(input())):
	(a, b, c) = [int(i) for i in input().split()]
	print(int(sqrt(a ** 2 + abs(b - c) ** 2)) + 1)


for _ in range(int(input())):
	num = list(map(int, input().split()))
	q = 0
	num.sort()
	c = num[0]
	a = num[1]
	b = num[2]
	print(int(((b - c) ** 2 + a ** 2) ** 0.5))


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


import sys
import math
t = int(sys.stdin.readline().strip())
for i in range(t):
	(a, b, c) = map(int, sys.stdin.readline().split())
	ans = int(math.sqrt(a * a + (b + c) * (b + c)))
	print(ans)


t = int(input())
while t:
	t -= 1
	l = list(map(int, input().split()))
	l.sort()
	print(l[2] + l[1] - 1)


import math
for _ in range(int(input())):
	A = sorted([int(_) for _ in input().split()])
	print(sum(A) - 1)


import math
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	l = [a, b, c]
	l.sort()
	d = int((l[0] ** 2 + (l[2] - l[1]) ** 2) ** 0.5)
	print(d)


import math
t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	d = round(math.sqrt(a ** 2 + (b - c) ** 2))
	print(d)


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


import sys
t = int(input().strip())
for a0 in range(t):
	l = [int(i) for i in input().split()]
	l.sort()
	a = l[2] - l[1] - l[0]
	if a > 0:
		print(a + 1)
	else:
		print(1)


import sys
import os
import math
import copy
from bisect import bisect
from io import BytesIO, IOBase
from math import sqrt, floor, factorial, gcd, log, ceil
from collections import deque, Counter, defaultdict
from itertools import permutations, combinations, accumulate

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

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

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

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

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

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

def Hash():
	return dict()

def Mod():
	return 1000000007

def Mat2x2(n):
	return [List() for _ in range(n)]

def Lcm(x, y):
	return x * y // gcd(x, y)

def dtob(n):
	return bin(n).replace('0b', '')

def btod(n):
	return int(n, 2)

def watch(x):
	return print(x)

def common(l1, l2):
	return set(l1).intersection(l2)

def Most_frequent(list):
	return max(set(list), key=list.count)

def solution():
	for i in range(Int()):
		a = List()
		a.sort()
		print(a[0] + a[2] - a[1])
solution()


import math
T = int(input())
for t in range(T):
	(a, b, c) = map(int, input().split())
	d = False
	print(a + b + c - 1)


for _ in range(int(input())):
	sides = list(map(int, input().split()))
	a = sorted(sides)
	mi = max(a[-1] - a[0] - a[1], 1)
	ma = sum(a)
	ans = ma - 1
	print(ans)


T = int(input())
for _ in range(T):
	(a, b, c) = map(int, input().split())
	sides = sorted([a, b, c])
	longest = sides[-1]
	rest = longest - (sides[0] + sides[1])
	if rest < 0:
		rest = 0
	ans = rest + 1
	print(ans)


import os

def f(a, b, c):
	res = a + b + c - 1
	return res
t = int(input())
for testcase in range(t):
	(a, b, c) = [int(x) for x in input().split()]
	print(f(a, b, c))


def main(a, b, c):
	return max(a, b, c)
ts = []
t = int(input())
for _ in range(t):
	ts.append(map(int, input().split()))
for el in ts:
	print(main(*el))


num = int(input())
for i in range(num):
	(a, b, c) = input().split()
	(a, b, c) = (int(a), int(b), int(c))
	if c > a:
		ca = c - a
	elif a > c:
		ca = a - c
	else:
		ca = 0
	pit = (ca ** 2 + b ** 2) ** (1 / 2)
	if type(pit) != int:
		print(int(pit) + 1)
	else:
		print(pit)


from math import sqrt as st
t = int(input())
for _ in range(t):
	l = list(map(int, input().split()))
	l.sort
	a = st(l[0] * l[0] + abs(l[1] - l[2]) * abs(l[1] - l[2]))
	print(round(a + 1))


from sys import stdin
input = lambda : stdin.readline().strip()
lin = lambda : list(map(int, input().split()))
iin = lambda : int(input())
main = lambda : map(int, input().split())
from math import ceil, sqrt, factorial, log
from collections import deque
from bisect import bisect_left

def gcd(a, b):
	(a, b) = (max(a, b), min(a, b))
	while a % b != 0:
		(a, b) = (b, a % b)
	return b
mod = 998244353

def solve(we):
	l = lin()
	l.sort()
	if l[-1] == l[-2]:
		print(l[0])
	else:
		print(ceil(sqrt(l[0] * l[0] + (l[-1] - l[-2]) ** 2)))
qwe = 1
qwe = int(input())
for _ in range(qwe):
	solve(_ + 1)


cases = []
for i in range(int(input(''))):
	cases.append([int(j) for j in input('').split(' ')])
for c in cases:
	print(max(c))


test = int(input())
for i in range(test):
	a = list(map(int, input().split(' ')))
	if a[0] == a[1] and a[0] == a[2]:
		print(a[0])
	else:
		th4 = int(((a[0] - a[1]) ** 2 + a[2] ** 2) ** (1 / 2))
		print(th4)


import math
t = int(input())
for _ in range(t):
	abc = input().split(' ')
	a = int(abc[0])
	b = int(abc[1])
	c = int(abc[2])
	v = [a, b, c]
	v.sort()
	d = v[1] + v[2]
	print(d)


import math
for i in range(int(input())):
	l = list(map(int, input().split()))
	l = sorted(l)
	a1 = max(l) - min(l)
	print(math.ceil((a1 ** 2 + l[1] ** 2) ** 0.5))


for i in range(int(input())):
	s = input()
	(a, b, c) = s.split(' ')
	a = int(a)
	b = int(b)
	c = int(c)
	if a > b:
		a -= b
	else:
		a = b - a
	print(c + (a + 1) - 1)


import math
for _ in range(int(input())):
	(a, b, c) = sorted(list(map(int, input().split())))
	print(int(math.sqrt((c - b) * (c - b) + a * a)))


import math
for i in range(int(input())):
	(a, b, c) = map(int, input().split())
	d = abs(b - c)
	res = a ** 2 + d ** 2
	fres = math.sqrt(res)
	fres = math.ceil(fres)
	print(fres)


from collections import Counter as cnt, defaultdict as dic
iin = lambda : int(input())
lin = lambda : list(map(int, input().rstrip().split()))
TEST_CASES = True

def main():
	(a, b, c) = lin()
	x = a + b + c - 1
	print(x)
if not TEST_CASES:
	main()
else:
	[main() for _ in range(int(input()))]


T = int(input())
for t in range(T):
	st = input().split()
	(a, b, c) = (int(st[0]), int(st[1]), int(st[2]))
	print(a + b + c - 1)


import sys
for i in range(0, int(sys.stdin.readline())):
	sys.stdout.write(str(sum(list(map(int, sys.stdin.readline().split()))) - 1) + '\n')


t = int(input())
for i in range(t):
	(a, b, c) = list(map(int, input().split()))
	arr = []
	arr.append(a)
	arr.append(b)
	arr.append(c)
	arr.sort()
	print(arr[2])


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


a = int(input())
for i in range(0, a):
	arr = list(map(int, input().split()))
	print(max(arr))


import math
t = int(input())
while t:
	t -= 1
	l = sorted(list(map(int, input().split())))
	k = l[0] * l[0] + (l[2] - l[1]) * (l[2] - l[1])
	print(math.ceil(math.sqrt(k)))


for t in range(int(input())):
	v = sorted(list(map(int, input().split())))
	print(max(1, v[2] - v[0] - v[1] + 1))


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


t = int(input())
s = []
for i in range(t):
	(a, b, c) = input().split()
	d = int(a) + int(b) + int(c) - 1
	s.append(d)
for i in range(t):
	print(s[i])


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 math import gcd, ceil

def prod(a, mod=10 ** 9 + 7):
	ans = 1
	for each in a:
		ans = ans * each % mod
	return ans

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

def binary(x, length=16):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y
from math import sqrt
for _ in range(int(input()) if True else 1):
	(a, b, c) = map(int, input().split())
	(a, b, c) = sorted([a, b, c])
	print(ceil(sqrt(b * b + c * c - a * a)))


import sys
input = sys.stdin.buffer.readline
T = int(input())
for testcase in range(T):
	(a, b, c) = map(int, input().split())
	print(a + b + c - 1)


from math import *
sInt = lambda : int(input())
mInt = lambda : map(int, input().split())
lInt = lambda : list(map(int, input().split()))
t = sInt()
for _ in range(t):
	(a, b, c) = mInt()
	print(a + b + c - 1)


import math
n = int(input())
a = []
for i in range(n):
	x = list(map(int, input().split()))
	print(math.ceil(math.sqrt((x[0] - 0) * (x[0] - 0) + (x[1] - x[2]) * (x[1] - x[2]))))


from sys import stdin
imput = stdin.read
t = input()
for i in range(int(t)):
	(a, b, c) = [int(i) for i in input().split()]
	max1 = max(a, b, c)
	if max1 == 1:
		print(1)
	else:
		print(max1 - 1)


def find_d(a, b, c):
	max_side = max(a, b, c)
	others_sum = a + b + c - max_side
	d = max(1, max_side - others_sum + 1)
	return d
num_cases = int(input())
cases = []
for i in range(num_cases):
	sides = input()
	cases.append(list(map(int, sides.split(' '))))
for case in cases:
	print(find_d(case[0], case[1], case[2]))


import sys

def input():
	return sys.stdin.readline()[:-1]

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

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

def getIntList():
	return list(getIntIter())

def flush():
	sys.stdout.flush()
for _ in range(getInt()):
	nums = getIntList()
	m = max(nums)
	s = sum(nums) - m
	print(max(1, m - s + 1))


import math
for _ in range(int(input())):
	print(sum([int(i) for i in input().split()]) - 1)


t = int(input())
for _ in range(t):
	n = [int(x) for x in input().split()]
	print(max(n))


from sys import stdin, stdout
import math
input = stdin.readline
for _ in range(int(input())):
	(n, l, k) = map(int, input().split())
	print(max(n, l, k))


from functools import cmp_to_key
from collections import deque
from heapq import heappush, heappop
from math import log, ceil
import sys
import os
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')
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))

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()

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

def ii():
	return int(inp())

def li(lag=0):
	l = list(map(int, inp().split()))
	if lag != 0:
		for i in range(len(l)):
			l[i] += lag
	return l

def mi(lag=0):
	matrix = list()
	for i in range(n):
		matrix.append(li(lag))
	return matrix

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

def print_list(lista, space=' '):
	print(space.join(map(str, lista)))

class UnionFind:

	def __init__(self, n):
		self.parent = list(range(n))
		self.size = [1] * n
		self.num_sets = n

	def find(self, a):
		to_update = []
		while a != self.parent[a]:
			to_update.append(a)
			a = self.parent[a]
		for b in to_update:
			self.parent[b] = a
		return self.parent[a]

	def merge(self, a, b):
		a = self.find(a)
		b = self.find(b)
		if a == b:
			return
		if self.size[a] < self.size[b]:
			(a, b) = (b, a)
		self.num_sets -= 1
		self.parent[b] = a
		self.size[a] += self.size[b]

	def set_size(self, a):
		return self.size[self.find(a)]

	def __len__(self):
		return self.num_sets

def bisect_left(a, x):
	left = 0
	right = len(a)
	while left < right:
		mid = (left + right) // 2
		if a[mid] < x:
			left = mid + 1
		else:
			right = mid
	return left

def bisect_right(a, x):
	left = 0
	right = len(a)
	while left < right:
		mid = (left + right) // 2
		if a[mid] > x:
			right = mid
		else:
			left = mid + 1
	return left

def bisect_elements(a, x):
	return bisect_right(a, x) - bisect_left(a, x)

def custom_sort(lista):

	def cmp(x, y):
		if x + y > y + x:
			return 1
		else:
			return -1
	return sorted(lista, key=cmp_to_key(cmp))
MOD = 10 ** 9 + 7
maxN = 10 ** 5
FACT = [0] * maxN

def add(x, y):
	return (x + y) % MOD

def multiply(x, y):
	return x * y % MOD

def power(x, y):
	if y == 0:
		return 1
	elif y % 2:
		return multiply(x, power(x, y - 1))
	else:
		a = power(x, y // 2)
		return multiply(a, a)

def inverse(x):
	return power(x, MOD - 2)

def divide(x, y):
	return multiply(x, inverse(y))

def allFactorials():
	FACT[0] = 1
	for i in range(1, maxN):
		FACT[i] = multiply(i, FACT[i - 1])

def coeffBinom(n, k):
	if n < k:
		return 0
	return divide(FACT[n], multiply(FACT[k], FACT[n - k]))

def primes(N):
	smallest_prime = [1] * (N + 1)
	prime = []
	smallest_prime[0] = 0
	smallest_prime[1] = 0
	for i in range(2, N + 1):
		if smallest_prime[i] == 1:
			prime.append(i)
			smallest_prime[i] = i
		j = 0
		while j < len(prime) and i * prime[j] <= N:
			smallest_prime[i * prime[j]] = min(prime[j], smallest_prime[i])
			j += 1
	return (prime, smallest_prime)

def gcd(a, b):
	(s, t, r) = (0, 1, b)
	(old_s, old_t, old_r) = (1, 0, a)
	while r != 0:
		quotient = old_r // r
		(old_r, r) = (r, old_r - quotient * r)
		(old_s, s) = (s, old_s - quotient * s)
		(old_t, t) = (t, old_t - quotient * t)
	return (old_r, old_s, old_t)

def create_graph(n, m, undirected=1, unweighted=1):
	graph = [[] for i in range(n)]
	if unweighted:
		for i in range(m):
			[x, y] = li(lag=-1)
			graph[x].append(y)
			if undirected:
				graph[y].append(x)
	else:
		for i in range(m):
			[x, y, w] = li(lag=-1)
			w += 1
			graph[x].append([y, w])
			if undirected:
				graph[y].append([x, w])
	return graph

def create_tree(n, unweighted=1):
	children = [[] for i in range(n)]
	if unweighted:
		for i in range(n - 1):
			[x, y] = li(lag=-1)
			children[x].append(y)
			children[y].append(x)
	else:
		for i in range(n - 1):
			[x, y, w] = li(lag=-1)
			w += 1
			children[x].append([y, w])
			children[y].append([x, w])
	return children

def create_edges(m, unweighted=0):
	edges = list()
	if unweighted:
		for i in range(m):
			edges.append(li(lag=-1))
	else:
		for i in range(m):
			[x, y, w] = li(lag=-1)
			w += 1
			edges.append([w, x, y])
	return edges

def dist(tree, n, A, B=-1):
	s = [[A, 0]]
	(massimo, massimo_nodo) = (0, 0)
	distanza = -1
	v = [-1] * n
	while s:
		(el, dis) = s.pop()
		if dis > massimo:
			massimo = dis
			massimo_nodo = el
		if el == B:
			distanza = dis
		for child in tree[el]:
			if v[child] == -1:
				v[child] = 1
				s.append([child, dis + 1])
	return (massimo, massimo_nodo, distanza)

def diameter(tree):
	(_, foglia, _) = dist(tree, n, 0)
	(diam, _, _) = dist(tree, n, foglia)
	return diam

def dfs(graph, n, A):
	v = [-1] * n
	s = [[A, 0]]
	v[A] = 0
	while s:
		(el, dis) = s.pop()
		for child in graph[el]:
			if v[child] == -1:
				v[child] = dis + 1
				s.append([child, dis + 1])
	return v

def bfs(graph, n, A):
	v = [-1] * n
	s = deque()
	s.append([A, 0])
	v[A] = 0
	while s:
		(el, dis) = s.popleft()
		for child in graph[el]:
			if v[child] == -1:
				v[child] = dis + 1
				s.append([child, dis + 1])
	return v

def connected(graph, n):
	v = dfs(graph, n, 0)
	for el in v:
		if el == -1:
			return False
	return True

def topological(graph, n):
	indegree = [0] * n
	for el in range(n):
		for child in graph[el]:
			indegree[child] += 1
	s = deque()
	for el in range(n):
		if indegree[el] == 0:
			s.append(el)
	order = []
	while s:
		el = s.popleft()
		order.append(el)
		for child in graph[el]:
			indegree[child] -= 1
			if indegree[child] == 0:
				s.append(child)
	if n == len(order):
		return (False, order)
	else:
		return (True, [])

def bipartite(graph, n):
	color = [-1] * n
	color[0] = 0
	s = [0]
	while s:
		el = s.pop()
		for child in graph[el]:
			if color[child] == color[el]:
				return False
			if color[child] == -1:
				s.append(child)
			color[child] = 1 - color[el]
	return True

def dijkstra(graph, n, A):
	dist = [float('inf') for i in range(n)]
	prev = [-1 for i in range(n)]
	dist[A] = 0
	pq = []
	heappush(pq, [0, A])
	while pq:
		[d_v, v] = heappop(pq)
		if d_v != dist[v]:
			continue
		for (to, w) in graph[v]:
			if dist[v] + w < dist[to]:
				dist[to] = dist[v] + w
				prev[to] = v
				heappush(pq, [dist[to], to])
	return (dist, prev)

def dijkstra_0_1(graph, n, A):
	dist = [float('inf') for i in range(n)]
	dist[A] = 0
	p = deque()
	p.append(A)
	while p:
		v = p.popleft()
		for (to, w) in graph[v]:
			if dist[v] + w < dist[to]:
				dist[to] = dist[v] + w
			if w == 1:
				q.append(to)
			else:
				q.appendleft(to)
	return dist

def floyd_warshall(graph, n):
	dist = [[float('inf') for _ in range(n)] for _ in range(n)]
	for i in range(n):
		dist[i][i] = 0
		for (child, d) in graph[i]:
			dist[i][child] = d
			dist[child][i] = d
	for k in range(n):
		for i in range(n):
			for j in range(j):
				dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j])
	return dist

def minimum_spanning_tree(edges, n):
	edges = sorted(edges)
	union_find = UnionFind(n)
	used_edges = list()
	for (w, x, y) in edges:
		if union_find.find(x) != union_find.find(y):
			union_find.merge(x, y)
			used_edges.append([w, x, y])
	return used_edges

def parents_children_root_unrooted_tree(tree, n, root=0):
	q = deque()
	visited = [0] * n
	parent = [-1] * n
	children = [[] for i in range(n)]
	q.append(root)
	while q:
		all_done = 1
		visited[q[0]] = 1
		for child in tree[q[0]]:
			if not visited[child]:
				all_done = 0
				q.appendleft(child)
		if all_done:
			for child in tree[q[0]]:
				if parent[child] == -1:
					parent[q[0]] = child
					children[child].append(q[0])
			q.popleft()
	return (parent, children)

def all_longest_path_passing_from_node(parent, children, n):
	q = deque()
	visited = [len(children[i]) for i in range(n)]
	downwards = [[0, 0] for i in range(n)]
	upward = [1] * n
	longest_path = [1] * n
	for i in range(n):
		if not visited[i]:
			q.append(i)
			downwards[i] = [1, 0]
	while q:
		node = q.popleft()
		if parent[node] != -1:
			visited[parent[node]] -= 1
			if not visited[parent[node]]:
				q.append(parent[node])
		else:
			root = node
		for child in children[node]:
			downwards[node] = sorted([downwards[node][0], downwards[node][1], downwards[child][0] + 1], reverse=True)[0:2]
	s = [node]
	while s:
		node = s.pop()
		if parent[node] != -1:
			if downwards[parent[node]][0] == downwards[node][0] + 1:
				upward[node] = 1 + max(upward[parent[node]], downwards[parent[node]][1])
			else:
				upward[node] = 1 + max(upward[parent[node]], downwards[parent[node]][0])
		longest_path[node] = downwards[node][0] + downwards[node][1] + upward[node] - min([downwards[node][0], downwards[node][1], upward[node]]) - 1
		for child in children[node]:
			s.append(child)
	return longest_path

def finding_ancestors(parent, queries, n):
	steps = int(ceil(log(n, 2)))
	ancestors = [[-1 for i in range(n)] for j in range(steps)]
	ancestors[0] = parent
	for i in range(1, steps):
		for node in range(n):
			if ancestors[i - 1][node] != -1:
				ancestors[i][node] = ancestors[i - 1][ancestors[i - 1][node]]
	result = []
	for (node, k) in queries:
		ans = node
		if k >= n:
			ans = -1
		i = 0
		while k > 0 and ans != -1:
			if k % 2:
				ans = ancestors[i][ans]
			k = k // 2
			i += 1
		result.append(ans)
	return result

def prefix_sum(arr):
	r = [0] * (len(arr) + 1)
	for (i, el) in enumerate(arr):
		r[i + 1] = r[i] + el
	return r

def nearest_from_the_left_smaller_elements(arr):
	n = len(arr)
	res = [-1] * n
	s = []
	for (i, el) in enumerate(arr):
		while s and s[-1] >= el:
			s.pop()
		if s:
			res[i] = s[-1]
		s.append(el)
	return res

def sliding_window_minimum(arr, k):
	res = []
	q = deque()
	for (i, el) in enumerate(arr):
		while q and arr[q[-1]] >= el:
			q.pop()
		q.append(i)
		while q and q[0] <= i - k:
			q.popleft()
		if i >= k - 1:
			res.append(arr[q[0]])
	return res
t = ii()
for test in range(t):
	a = li()
	a = sorted(a)
	print(int((a[0] ** 2 + (a[1] - a[2]) ** 2) ** 0.5))


T = int(input())
for t in range(T):
	xs = [int(x) for x in input().split()]
	g = sum(xs)
	print(g - 1)


input = __import__('sys').stdin.readline
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	print(a + b + c - 1)


from sys import stdin, stdout
from math import gcd, log2, log10, floor, ceil, sqrt
import math
from collections import defaultdict, OrderedDict
from bisect import bisect_left
for i in range(int(input())):
	a = list(map(int, input().split()))
	print(sum(a) - 1)


for s in [*open(0)][1:]:
	print(max(map(int, s.split())))


import math
t = int(input())
for tc in range(t):
	line = input().split()
	arr = [int(line[0]), int(line[1]), int(line[2])]
	arr.sort()
	print(int(math.ceil(arr[0] + arr[-1])))


from sys import stdin, stdout
import math
import heapq
import collections
input = stdin.readline

def inputnum():
	return int(input())

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

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

def inputstring():
	return [x for x in input()]

def inputstrings():
	return [x for x in input().split()]

def inputstringnum():
	return [ord(x) - ord('a') for x in input()]

def inputmatrixchar(rows):
	arr2d = [[j for j in input().strip()] for i in range(rows)]
	return arr2d

def inputmatrixint(rows):
	arr2d = []
	for _ in range(rows):
		arr2d.append([int(i) for i in input().split()])
	return arr2d
t = int(input())
for q in range(t):
	(a, b, c) = inputnums()
	print(a + b + c - 1)


import sys, math
input = sys.stdin.readline
t = int(input())
for r in range(t):
	l = list(map(int, input().split()))
	print(max(l) + 1)


t = int(input())
for i in range(t):
	arr = list(map(int, input().split()))
	arr = sorted(arr)
	if arr[0] + arr[1] >= arr[2]:
		print(1)
	else:
		ans = arr[2] - (arr[1] + arr[0])
		ans += 1
		print(ans)


def solve(a, b, c):
	if a == b and b == c:
		print(a)
	elif a == b:
		print(c)
	elif b == c:
		print(a)
	elif c == a:
		print(b)
	else:
		print(max(c, a, b) + 1)
noOfTestCases = int(input())
for i in range(noOfTestCases):
	(a, b, c) = map(int, input().split())
	solve(a, b, c)


t = int(input())
for i in range(t):
	l = [int(x) for x in input().split(' ')]
	l.sort()
	print(l[-1] + l[-2] - 1)


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


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


import math
T = int(input())
for t in range(T):
	(a, b, c) = map(int, input().split())
	l = abs(c - a)
	d = int(math.sqrt(l ** 2 + b ** 2))
	print(d)


def STR():
	return list(input())

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

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

def MAP2():
	return map(float, input().split())

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

def STRING():
	return input()
import string
import sys
from heapq import heappop, heappush, heapify
from bisect import *
from collections import deque, Counter, defaultdict
from math import *
from itertools import permutations, accumulate
dx = [-1, 1, 0, 0]
dy = [0, 0, 1, -1]
for tt in range(INT()):
	a = LIST()
	print(sum(a) - 1)


for case in range(int(input())):
	temp = [int(x) for x in input().split()]
	temp.sort()
	(a, b, c) = temp
	print(a + c - b)


for i in range(int(input())):
	v = list(map(int, input().split()))
	c = max(v)
	c = c + 1
	print(c)


for i in range(int(input())):
	x = list(map(int, input().strip().split()))
	x.sort()
	(a, b, c) = x
	d = max(c - a - b, 0) + 1
	print(d)


for i in range(int(input())):
	(*li,) = map(int, input().split())
	print(max(li))


from sys import stdin
for _ in range(int(stdin.readline())):
	(a, b, c) = map(int, stdin.readline().split())
	(a, b, c) = sorted([a, b, c])
	ans = a + b - 1
	print(a + b + c - 2)


import math
t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	l = [a, b, c]
	l.sort()
	c1 = l[2] - l[0]
	c2 = l[1]
	print(int(math.sqrt(c1 * c1 + c2 * c2)))


from sys import stdin, stdout
n = int(stdin.readline())
for i in range(n):
	lst = [int(i) for i in stdin.readline().split()]
	lst.sort()
	if lst[2] - lst[1] - lst[0] > 0:
		ans = lst[2] - lst[1] - lst[0] + 1
	else:
		ans = lst[2] + lst[1] + lst[0] - 1
	stdout.write(str(ans) + '\n')


import math
t = int(input())
for i in range(t):
	distance = list(map(int, input().split()))
	p1 = [0, 0]
	p2 = [distance[0], 0]
	p3 = [distance[0], distance[1]]
	if distance[1] < 0:
		p4 = [0, distance[2]]
	if distance[1] > 0:
		p4 = [0, -1 * distance[2]]
	distance = math.sqrt((p3[0] - p4[0]) ** 2 + (p3[1] - p4[1]) ** 2)
	print(int(distance))


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from heapq import *
from math import gcd, factorial, floor, ceil
from copy import deepcopy
from collections import deque
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
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))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 10 ** 9 + 7

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 zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for pp in range(t):
		solve(pp)

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def google(p):
	print('Case #' + str(p) + ': ', end='')

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

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def solve(case):
	(a, b, c) = sep()
	print(max(a, b, c) + 1)
testcase(int(inp()))


def ii():
	return int(input())

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

def li():
	return list(map(int, input().split()))
t = int(input())
for _ in range(t):
	(a, b, c) = mi()
	print(a + b + c - 1)


t = int(input())
for _ in range(t):
	l = sorted(list(map(int, input().split())))
	s = int(((l[2] - l[0]) ** 2 + l[1] ** 2) ** 0.5)
	print(s)


import math
t = int(input())
while t != 0:
	t -= 1
	li = list(map(int, input().split()))
	c = 0
	dic = {}
	for i in li:
		if i not in dic:
			dic[i] = 1
		else:
			dic[i] += 1
	c = len(dic.keys())
	if c == 1:
		print(li[0])
	elif c == 2:
		for i in dic:
			if dic[i] == 1:
				print(i)
	elif c == 3:
		x = max(li)
		li.remove(x)
		y = min(li)
		li.remove(y)
		print(x - li[0] + (li[0] - y))


l = []
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	l.append(a + abs(b - c))
for i in l:
	print(i)


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

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

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

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

def inp():
	return 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 = int((right + left) / 2)
		if arr[mid] <= key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

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 mex(list1):
	p = max(list1) + 1
	for i in range(len(list1)):
		if list1[i] != i:
			p = i
			break
	return p

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 binpowmodulus(a, b, m):
	a %= m
	res = 1
	while b > 0:
		if b & 1:
			res = res * a % m
		a = a * a % m
		b >>= 1
	return 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 prime(x):
	if x == 1:
		return False
	else:
		for i in range(2, int(math.sqrt(x)) + 1):
			if x % i == 0:
				return False
		else:
			return True

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 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
res = set()

def solven(p, l, a, b, n):
	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 good(b):
	l = []
	i = 0
	while len(b) != 0:
		if b[i] < b[len(b) - 1 - i]:
			l.append(b[i])
			b.remove(b[i])
		else:
			l.append(b[len(b) - 1 - i])
			b.remove(b[len(b) - 1 - i])
	if l == sorted(l):
		return True
	return False

def main():
	t = inpu()
	for _ in range(t):
		(a, b, c) = sep()
		d = math.sqrt(pow(b + c, 2) + pow(a, 2))
		print(int(d) - 1)
main()


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	ans = max(a, b, c)
	cur = a + b + c - max(a, b, c) - min(a, b, c)
	di = ans ** 2 + cur ** 2
	di = di ** 0.5
	di -= min(a, b, c)
	print(int(di) + 1)


from math import sqrt, ceil

def solve(a, b, c):
	p = [a, b, c]
	p.sort()
	a = p[0]
	b = p[1]
	c = p[2]
	d = sqrt((c - b) ** 2 + a ** 2)
	print(ceil(d))
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	solve(a, b, c)


from math import ceil
t = int(input())
while t > 0:
	t -= 1
	(a, b, c) = map(int, input().split())
	print(a + b + c - 1)


from sys import stdin, stdout
from heapq import *
st = lambda : list(stdin.readline().strip())
li = lambda : list(map(int, stdin.readline().split()))
mp = lambda : map(int, stdin.readline().split())
inp = lambda : int(stdin.readline())
pr = lambda n: stdout.write(str(n) + '\n')
mod = 1000000007
INF = float('inf')

def solve():
	l = li()
	l.sort()
	pr(l[-1] + l[1] - l[0])
for _ in range(inp()):
	solve()


import math

def range_input():
	return range(int(input()))

def map_int_input():
	return list(map(int, input().split()))
for t in range_input():
	(a, b, c) = map_int_input()
	num = max(a, b, c)
	print(num)


t = int(input(''))
for _ in range(t):
	arr = list(map(int, input().split()))
	arr.sort()
	print(arr[2])


t = int(input())
for case in range(t):
	(a, b, c) = list(map(int, input().split()))
	arr = list(sorted([a, b, c]))
	minsm = a + b
	min_len = abs(c - minsm)
	print(min_len + 1)


import sys

def eprint(*args):
	print(*args, file=sys.stderr)
zz = 1
if zz:
	input = sys.stdin.readline
else:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('all.txt', 'w')
di = [[-1, 0], [1, 0], [0, 1], [0, -1]]

def string(s):
	return ''.join(s)

def fori(n):
	return [fi() for i in range(n)]

def inc(d, c, x=1):
	d[c] = d[c] + x if c in d else x

def bo(i):
	return ord(i) - ord('A')

def li():
	return [int(xx) for xx in input().split()]

def fli():
	return [float(x) for x in input().split()]

def comp(a, b):
	if a > b:
		return 2
	return 2 if a == b else 0

def gi():
	return [xx for xx in input().split()]

def cil(n, m):
	return n // m + int(n % m > 0)

def fi():
	return int(input())

def pro(a):
	return reduce(lambda a, b: a * b, a)

def swap(a, i, j):
	(a[i], a[j]) = (a[j], a[i])

def si():
	return list(input().rstrip())

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

def gh():
	sys.stdout.flush()

def isvalid(i, j):
	return 0 <= i < n and 0 <= j < m and (a[i][j] != '.')

def bo(i):
	return ord(i) - ord('a')

def graph(n, m):
	for i in range(m):
		(x, y) = mi()
		a[x].append(y)
		a[y].append(x)
t = fi()
while t > 0:
	t -= 1
	a = li()
	print(sum(a) - 1)


from sys import stdin, stdout
test = int(stdin.readline())
for _ in range(test):
	(a, b, c) = map(int, stdin.readline().split())
	print(max(a, b, c) + 1)