Vlad went into his appartment house entrance, now he is on the $1$-th floor. He was going to call the elevator to go up to his apartment.

There are only two elevators in his house. Vlad knows for sure that:

the first elevator is currently on the floor $a$ (it is currently motionless),

the second elevator is located on floor $b$ and goes to floor $c$ ($b \ne c$). Please note, if $b=1$, then the elevator is already leaving the floor $1$ and Vlad does not have time to enter it.

If you call the first elevator, it will immediately start to go to the floor $1$. If you call the second one, then first it will reach the floor $c$ and only then it will go to the floor $1$. It takes $|x - y|$ seconds for each elevator to move from floor $x$ to floor $y$.

Vlad wants to call an elevator that will come to him faster. Help him choose such an elevator.


-----Input-----

The first line of the input contains the only $t$ ($1 \le t \le 10^4$) — the number of test cases.

This is followed by $t$ lines, three integers each $a$, $b$ and $c$ ($1 \le a, b, c \le 10^8$, $b \ne c$) — floor numbers described in the statement.


-----Output-----

Output $t$ numbers, each of which is the answer to the corresponding test case. As an answer, output:

$1$, if it is better to call the first elevator;

$2$, if it is better to call the second one;

$3$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).


-----Examples-----

Input
3
1 2 3
3 1 2
3 2 1
Output
1
3
2


-----Note-----

In the first test case of the example, the first elevator is already on the floor of $1$.

In the second test case of the example, when called, the elevators would move as follows:

At the time of the call, the first elevator is on the floor of $3$, and the second one is on the floor of $1$, but is already going to another floor;

in $1$ second after the call, the first elevator would be on the floor $2$, the second one would also reach the floor $2$ and now can go to the floor $1$;

in $2$ seconds, any elevator would reach the floor $1$.

In the third test case of the example, the first elevator will arrive in $2$ seconds, and the second in $1$.

Difficulty: EASY

Solutions:
def fun(arr):
	a = arr[0]
	tmp = abs(arr[1] - arr[2]) + arr[2]
	if a < tmp:
		return 1
	elif a > tmp:
		return 2
	else:
		return 3
n = int(input())
l = []
for i in range(n):
	l.append([int(i) for i in input().split()])
for i in l:
	print(fun(i))


for s in [*open(0)][1:]:
	(a, b, c) = map(int, s.split())
	c += abs(b - c)
	print((a <= c) + 2 * (a >= c))


n = int(input())
l = []
for i in range(n):
	(a, b, c) = map(int, input().split())
	if a == abs(b - c) + c:
		l.append('3')
		continue
	if min(a, abs(b - c) + c) == a:
		l.append('1')
	else:
		l.append('2')
for i in l:
	print(i)


n = int(input())
l = []
for i in range(n):
	(a, b, c) = input().split()
	a = int(a)
	b = int(b)
	c = int(c)
	if b - c >= 0:
		d = b - c
	else:
		d = c - b
	if a > d + c:
		l.append(2)
	elif a < d + c:
		l.append(1)
	elif a == d + c:
		l.append(3)
for i in range(len(l)):
	print(l[i])


ans = ''
inpt = int(input())
for i in range(inpt):
	inpt = input().split()
	(a, b, c) = (int(inpt[0]), int(inpt[1]), int(inpt[2]))
	if c < b:
		if b < a:
			ans += '2'
		elif b == a:
			ans += '3'
		else:
			ans += '1'
	else:
		s_way_length = 2 * c - b
		if a > s_way_length:
			ans += '2'
		elif a == s_way_length:
			ans += '3'
		else:
			ans += '1'
for item in ans:
	print(item)


t = int(input())
ans = [3] * t
for i in range(t):
	(a, b, c) = map(int, input().split())
	if a < abs(b - c) + c:
		ans[i] = 1
	elif a > abs(b - c) + c:
		ans[i] = 2
for i in range(t):
	print(ans[i])


for nukea in [*open(0)][1:]:
	(adam, bee, carlson) = map(int, nukea.split())
	carlson += abs(bee - carlson)
	print((adam <= carlson) + 2 * (adam >= carlson))


t = int(input())
result = []
for i in range(t):
	(a, b, c) = map(int, input().split())
	f_lift_time = a - 1
	s_lift_time = abs(b - c) + c - 1
	if f_lift_time == s_lift_time:
		result.append('3')
	elif f_lift_time > s_lift_time:
		result.append('2')
	else:
		result.append('1')
print(*result, sep='\n')


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

def main():
	tests = int(input().rstrip())
	for i in range(tests):
		(a, b, c) = map(int, input().rstrip().split())
		el_1 = a - 1
		el_2 = abs(b - c) + (c - 1)
		if el_1 < el_2:
			output('1')
		elif el_1 > el_2:
			output('2')
		else:
			output('3')
		output('\n')
main()


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


import sys
sys.setrecursionlimit(10 ** 6)
from collections import Counter, deque, defaultdict
import math
import heapq
ip = sys.stdin.readline
op = sys.stdout.write
t = int(ip())
res = []
for _ in range(t):
	(a, b, c) = [int(x) for x in ip().split()]
	choice1 = a - 1
	choice2 = abs(c - b) + abs(c - 1)
	if choice1 == choice2:
		res.append(3)
	elif choice1 < choice2:
		res.append(1)
	else:
		res.append(2)
for val in res:
	op(str(val) + '\n')


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())
for _ in range(inp()):
	(a, b, c) = invr()
	dif1 = abs(a - 1)
	dif2 = abs(c - b) + abs(c - 1)
	if dif1 < dif2:
		print(1)
	elif dif1 > dif2:
		print(2)
	else:
		print(3)


import sys
input = sys.stdin.readline

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

def Solve():
	for t in range(int(input())):
		(a, b, c) = map(int, input().split())
		if abs(a - 1) < abs(b - c) + abs(c - 1):
			print(1)
		elif abs(a - 1) > abs(b - c) + abs(c - 1):
			print(2)
		else:
			print(3)
Solve()


import sys
readline = sys.stdin.readline
t = int(readline())
for _ in range(t):
	(a, b, c) = map(int, readline().split())
	t1 = a - 1
	t2 = abs(b - c) + abs(c - 1)
	if t1 < t2:
		print(1)
	elif t1 == t2:
		print(3)
	else:
		print(2)


import sys
input = sys.stdin.readline

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

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

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

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

def Two_Elevators(a, b, c):
	ele_one = a - 1
	ele_two = abs(b - c) + abs(c - 1)
	if ele_one == ele_two:
		return 3
	elif ele_one < ele_two:
		return 1
	else:
		return 2
num_testcases = inp()
for i in range(num_testcases):
	(a, b, c) = invr()
	sys.stdout.write(str(Two_Elevators(a, b, c)) + '\n')


import sys
sys.setrecursionlimit(200000)
import math
from collections import Counter
from collections import defaultdict
from collections import deque
input = sys.stdin.readline
from functools import lru_cache
import heapq

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())
testcases = inp()
for i in range(testcases):
	(a, b, c) = inlt()
	if a - 1 < max(1, abs(b - c)) + c - 1:
		print(1)
	elif a - 1 > max(1, abs(b - c)) + c - 1:
		print(2)
	else:
		print(3)


t = int(input())
answers = []
for i in range(t):
	(a, b, c) = map(int, input().split())
	a = abs(1 - a)
	bc = abs(b - c) + abs(1 - c)
	if a < bc:
		answers.append(1)
	elif a > bc:
		answers.append(2)
	else:
		answers.append(3)
for j in range(len(answers)):
	print(answers[j])


def res(a, b, c):
	if a > abs(b - c) + c:
		return 2
	elif a == abs(b - c) + c:
		return 3
	else:
		return 1
n = int(input())
re = []
for i in range(n):
	(a, b, c) = map(int, input().split())
	re.append(str(res(a, b, c)))
print('\n'.join(re))


import sys
arr = []
for line in sys.stdin:
	nums = [int(x) for x in line.strip().split()]
	for j in nums:
		arr.append(j)
test_cases = arr[0]
i = 1
for tc in range(test_cases):
	a = arr[i]
	b = arr[i + 1]
	c = arr[i + 2]
	i = i + 3
	if a < abs(b - c) + c:
		print(1)
	elif a > abs(b - c) + c:
		print(2)
	else:
		print(3)


import sys
testcases = input()
inputs = []
for t in range(0, int(testcases)):
	line = input()
	inputs.append(line)
for p in inputs:
	r = p.split()
	a = int(r[0])
	b = int(r[1])
	c = int(r[2])
	if a == 1:
		print(1)
	else:
		f = abs(a - 1)
		s = abs(c - b) + abs(c - 1)
		if f < s:
			print(1)
		elif s < f:
			print(2)
		else:
			print(3)


test_num = int(input())
final_list = []
for i in range(test_num):
	line = input()
	a = int(line.split(' ')[0])
	b = int(line.split(' ')[1])
	c = int(line.split(' ')[2])
	f_elev = abs(a - 1)
	s_elev = abs(b - c) + abs(c - 1)
	if f_elev < s_elev:
		final_list.append(1)
	elif s_elev < f_elev:
		final_list.append(2)
	else:
		final_list.append(3)
for i in final_list:
	print(i)


t = int(input())
i = 0
m = [1] * t
a = [1] * t
while i < t:
	a[i] = [int(x) for x in input().split(' ', 3)]
	y = 0
	if a[i][1] - a[i][2] > 0:
		y = a[i][1] - a[i][2]
	else:
		y = (a[i][1] - a[i][2]) * -1
	if a[i][0] - 1 < y + a[i][2] - 1:
		m[i] = 1
	elif a[i][0] - 1 == y + a[i][2] - 1:
		m[i] = 3
	else:
		m[i] = 2
	i += 1
r = 0
while r < t:
	print(m[r])
	r += 1


def fastelevator(a, b, c):
	if a == 1:
		return 1
	else:
		first = a - 1
		second = abs(c - b) + c - 1
		if first == second:
			return 3
		elif first < second:
			return 1
		else:
			return 2
l = []
N = int(input())
for i in range(N):
	input_list = list(map(int, input().split()))
	l.append(input_list)
for i in range(N):
	a = l[i][0]
	b = l[i][1]
	c = l[i][2]
	print(fastelevator(a, b, c))


n = int(input())
arr = []
for _ in range(n):
	arr.append(list(map(int, input().split())))
for i in arr:
	if i[2] > i[1]:
		x = i[2] - i[1]
		x += i[2] - 1
	elif i[1] > i[2] and i[2] != 1:
		x = i[1] - i[2]
		x += i[2] - 1
	elif i[1] > i[2] and i[2] == 1:
		x = i[1] - i[2]
	if i[0] == 1:
		y = 0
	elif i[0] != 1:
		y = i[0] - 1
	if x > y:
		print(1)
	elif x < y:
		print(2)
	else:
		print(3)


def Lift():
	(a, b, c) = map(int, input().split())
	if a < abs(b - c) + c:
		return 1
	elif a > abs(b - c) + c:
		return 2
	else:
		return 3
t = int(input())
m = []
for i in range(t):
	m.append(Lift())
for i in range(t):
	print(m[i])


a = int(input())
lis = [3] * a
for i in range(a):
	b = [int(x) for x in input().split()]
	if b[0] - 1 < abs(b[2] - b[1]) + abs(b[2] - 1):
		lis[i] = 1
	elif b[0] - 1 > abs(b[2] - b[1]) + abs(b[2] - 1):
		lis[i] = 2
for i in lis:
	print(i)


from sys import stdin
rd = stdin.readline
for __ in range(int(rd())):
	(a, b, c) = map(int, rd().split())
	if a < abs(b - c) + c:
		print(1)
	elif a == abs(b - c) + c:
		print(3)
	else:
		print(2)


n = int(input())
result = []
for i in range(0, n):
	(a, b, c) = map(int, input().split())
	s1 = a - 1
	s2 = abs(b - c) + c - 1
	result.append(1 if s1 < s2 else 2 if s2 < s1 else 3)
for j in result:
	print(j)


t = int(input())
s = []
for i in range(t):
	(a, b, c) = map(int, input().split())
	e = abs(a - 1)
	r = abs(b - c) + abs(c - 1)
	if e < r:
		s.append(1)
	elif e > r:
		s.append(2)
	elif e == r:
		s.append(3)
for j in range(len(s)):
	print(s[j])


import sys
t = int(sys.stdin.readline())
for i in range(t):
	(a, b, c) = map(int, sys.stdin.readline().strip().split())
	time1 = abs(a - 1)
	time2 = abs(c - b) + abs(c - 1)
	if time1 > time2:
		print(2)
	elif time1 < time2:
		print(1)
	else:
		print(3)


from collections import deque, Counter
from math import *
import sys
import random
from bisect import *
from functools import reduce
from sys import stdin
from heapq import *
import copy
input = lambda : sys.stdin.readline().rstrip()
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	if a < abs(b - c) + abs(c):
		print(1)
	elif a == abs(b - c) + abs(c):
		print(3)
	else:
		print(2)


t = int(input())
ans = []
for i in range(t):
	(a, b, c) = list(map(int, input().split()))
	sol1 = abs(a - 1)
	sol2 = abs(c - b) + abs(c - 1)
	if sol1 < sol2:
		ans.append(1)
	elif sol1 == sol2:
		ans.append(3)
	else:
		ans.append(2)
for j in ans:
	print(j)


N = int(input())
f = []
for i in range(N):
	a = list(map(int, input().split()))
	a1 = 0
	a2 = 0
	a1 = a[0] - 1
	a2 = abs(a[2] - a[1]) + a[2] - 1
	if a1 < a2:
		f.append(1)
	elif a2 < a1:
		f.append(2)
	else:
		f.append(3)
for t in f:
	print(t)


from re import A
t = int(input())
lists = []
for i in range(t):
	inp = list(map(int, input().split()))
	a = inp[0]
	b = inp[1]
	c = inp[2]
	t1 = a - 1
	t2 = abs(c - b) + abs(c - 1)
	if t1 < t2:
		elevator = 1
	elif t2 < t1:
		elevator = 2
	else:
		elevator = 3
	lists.append(elevator)
for x in range(len(lists)):
	print(lists[x])


a = int(input(''))
lis = []
for i in range(a):
	l = list(map(int, input().split()))
	(m1, m2, m3) = (l[0], l[1], l[2])
	if m1 > abs(m3 - m2) + m3:
		lis.append(2)
	elif m1 < abs(m3 - m2) + m3:
		lis.append(1)
	else:
		lis.append(3)
for i in range(len(lis)):
	print(lis[i])


def func(a):
	if a[0] - 1 > abs(a[1] - a[2]) + abs(a[2] - 1):
		return 2
	elif a[0] - 1 < abs(a[1] - a[2]) + abs(a[2] - 1):
		return 1
	else:
		return 3
try:
	t = int(input())
	arr = []
	for i in range(t):
		n = list(map(int, input().split(' ')))
		arr.append(n)
	for i in range(t):
		print(func(arr[i]))
except:
	pass


n = int(input())
arr = []
for i in range(n):
	arr.append([int(j) for j in input().split()])
for set in arr:
	if set[0] - 1 < abs(set[2] - set[1]) + set[2] - 1:
		print(1)
	elif set[0] - 1 > abs(set[2] - set[1]) + set[2] - 1:
		print(2)
	else:
		print(3)


def main():
	n = int(input())
	ans = []
	for i in range(n):
		(a, b, c) = map(int, input().split())
		a -= 1
		if c < b:
			time_ans = b - 1
		else:
			time_ans = -1 + b + (c - b) * 2
		if time_ans < a:
			ans.append(2)
		elif time_ans > a:
			ans.append(1)
		else:
			ans.append(3)
	for i in range(n):
		print(ans[i])
main()


def count_(list_):
	dec = abs(list_[2] - list_[1]) + abs(list_[2] - 1) - abs(list_[0] - 1)
	if dec == 0:
		return 3
	elif dec > 0:
		return 1
	else:
		return 2
count_tot = int(input())
list_of_list = []
for i in range(count_tot):
	list_of_list.append(list(map(int, input().strip().split())))
for i in list_of_list:
	print(count_(i))


t = int(input())
outputs = []
for _ in range(t):
	(a, b, c) = map(int, input().split())
	if a > c + abs(c - b):
		outputs.append(2)
	elif a < c + abs(c - b):
		outputs.append(1)
	else:
		outputs.append(3)
for output in outputs:
	print(output)


n = int(input())
data = []
for i in range(n):
	(a, b, c) = list(map(int, input().split()))
	data.append([a, b, c])
for i in range(len(data)):
	(a, b, c) = data[i]
	if a == 1:
		print(1)
	elif abs(a - 1) < abs(c - b) + abs(c - 1):
		print(1)
	elif abs(a - 1) > abs(c - b) + abs(c - 1):
		print(2)
	else:
		print(3)


t = int(input())
k = []
for i in range(t):
	m = input().split()
	n = list(m)
	for i in range(len(n)):
		n[i] = int(n[i])
	a = n[0]
	b = n[1]
	c = n[2]
	if a - 1 < abs(b - c) + abs(c - 1):
		k.append(1)
	elif a - 1 > abs(b - c) + abs(c - 1):
		k.append(2)
	else:
		k.append(3)
for i in k:
	print(i)


n = int(input())
l1 = []
for i in range(n):
	l1.append([int(x) for x in input().split()])
for i in range(n):
	a = l1[i][0] - 1
	b = abs(l1[i][1] - l1[i][2]) + l1[i][2] - 1
	if a < b:
		print(1)
	if a == b:
		print(3)
	if a > b:
		print(2)
print()


from functools import cmp_to_key
from collections import Counter, deque, defaultdict, OrderedDict
import math
from bisect import bisect, bisect_left
import sys
import re
from copy import deepcopy
MOD = 10 ** 9 + 7
MAX = -sys.maxsize
MIN = sys.maxsize

class get:

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

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

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

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

def sqrt(x):
	return int(math.sqrt(x)) + 1

def gcd(*args):
	result = args[0]
	for item in args:
		result = math.gcd(result, item)
	return result

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

def isPrime(n):
	if n == 1:
		return False
	for i in range(2, sqrt(n)):
		if n % i == 0:
			return False
	return True

def print2d(arr):
	for item in arr:
		print(*item)

def solve():
	(a, b, c) = get.map()
	x1 = abs(a - 1)
	x2 = abs(b - c) + abs(c - 1)
	if x1 == x2:
		print(3)
	elif x1 > x2:
		print(2)
	else:
		print(1)
t = int(input())
for tt in range(t):
	solve()


from collections import Counter
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):
	(a, b, c) = inlt()
	distA = a - 1
	if c > b:
		b = c + c - b
	distB = abs(b - 1)
	if distA == distB:
		print(3)
	else:
		print([1, 2][distA > distB])


t = int(input())
for i in range(t):
	l = input().split()
	(a, b, c) = (int(l[0]), int(l[1]), int(l[2]))
	(t1, t2) = (abs(a - 1), abs(c - b) + abs(c - 1))
	if t1 < t2:
		print(1)
	elif t1 > t2:
		print(2)
	else:
		print(3)


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	atrip = a - 1
	if b < c:
		btrip = 2 * (c - b) + (b - 1)
	else:
		btrip = b - 1
	if atrip < btrip:
		print(1)
	elif atrip > btrip:
		print(2)
	else:
		print(3)


N = int(input())
for _ in range(N):
	line = input()
	ss = [int(s) for s in line.split(' ')]
	a = ss[0]
	b = ss[1]
	c = ss[2]
	if b < c:
		c = c + (c - b)
	else:
		c = b
	if a > c:
		print('2')
	elif a < c:
		print('1')
	else:
		print('3')


t = int(input())
for i in range(t):
	ans = 0
	(a, b, c) = map(int, input().split())
	l1 = abs(a - 1)
	l2 = abs(b - c) + abs(c - 1)
	if l1 < l2:
		ans = 1
	elif l1 > l2:
		ans = 2
	else:
		ans = 3
	print(ans)


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


t = int(input())
for i in range(t):
	(a, b, c) = map(int, input().split())
	x = a - 1
	if c > b:
		y = 2 * c - b - 1
	else:
		y = b - 1
	if x == y:
		print(3)
	elif x < y:
		print(1)
	else:
		print(2)


for i in range(int(input())):
	l = list(map(int, input().split()))
	a = l[0]
	b = l[1]
	c = l[2]
	x = abs(a - 1)
	y = abs(c - b) + abs(c - 1)
	if x < y:
		print(1)
	elif x > y:
		print(2)
	else:
		print(3)


t = int(input())
while t:
	t -= 1
	(a, b, c) = map(int, input().split())
	a_time = a - 1
	b_time = abs(c - b) + abs(c - 1)
	if a_time < b_time:
		print(1)
	elif b_time < a_time:
		print(2)
	else:
		print(3)


def main():
	t = int(input())
	for _ in range(t):
		(a, b, c) = map(int, input().split())
		elevator_1 = abs(a - 1)
		elevator_2 = abs(b - c) + abs(1 - c)
		if elevator_1 < elevator_2:
			print('1')
		elif elevator_2 < elevator_1:
			print('2')
		else:
			print('3')
main()


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


t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	dis_b = abs(b - c) + abs(c - 1)
	dis_a = abs(a - 1)
	if dis_a < dis_b:
		print(1)
	elif dis_a == dis_b:
		print(3)
	else:
		print(2)


def solve(a, b, c):
	i = 1
	visit = False
	diffA = 0
	diffB = 0
	diffA = a - 1
	if c > b:
		diffB = c + (c - b) - 1
	else:
		diffB = b - 1
	if diffA < diffB:
		return 1
	elif diffB < diffA:
		return 2
	else:
		return 3

def main():
	t = int(input())
	for i in range(0, t):
		s = []
		s = input().split(' ')
		print(solve(int(s[0]), int(s[1]), int(s[2])))
main()


t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	a1 = abs(a - 1)
	a2 = abs(c - b) + abs(c - 1)
	if a1 > a2:
		print(2)
	elif a2 > a1:
		print(1)
	else:
		print(3)


def solve():
	result = []
	t = int(input())
	for _ in range(t):
		(a, b, c) = tuple(map(int, input().split()))
		elevator_1 = abs(a - 1)
		elevator_2 = abs(b - c) + abs(c - 1)
		if elevator_1 == elevator_2:
			result.append(3)
		else:
			result.append(1 if elevator_1 < elevator_2 else 2)
	for r in result:
		print(r)
solve()


data = []
for _ in range(int(input())):
	(a, b, c) = list(map(int, input().split()))
	data.append([a, b, c])
for d in data:
	(a, b, c) = d
	if abs(a - 1) < abs(b - c) + abs(c - 1):
		print('1')
	if abs(a - 1) > abs(b - c) + abs(c - 1):
		print('2')
	if abs(a - 1) == abs(b - c) + abs(c - 1):
		print('3')


import sys
import math
from collections import Counter

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

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

def fun(a, b, c):
	if abs(a - 1) < abs(b - c) + abs(c - 1):
		return 1
	if abs(a - 1) > abs(b - c) + abs(c - 1):
		return 2
	return 3
for _ in range(int(input())):
	(a, b, c) = gi()
	print(fun(a, b, c))


for i in range(int(input())):
	(a, b, c) = [int(i) for i in input().split()]
	if a == 1:
		print(1)
	else:
		first = 0
		second = 0
		first = a - 1
		if c == 1:
			second = b - 1
		elif b > c:
			second = b - 1
		else:
			second = c - b
			second += c - 1
		if first < second:
			print(1)
		elif second < first:
			print(2)
		elif second == first:
			print(3)


def solution(a, b, c):
	if b > c:
		if a == b:
			return 3
		elif a > b:
			return 2
		else:
			return 1
	else:
		time = c + abs(b - c)
		if a == time:
			return 3
		elif a > time:
			return 2
		else:
			return 1
t = int(input())
while t:
	(a, b, c) = [int(x) for x in input().strip().split(' ')]
	print(solution(a, b, c))
	t -= 1


t = int(input())
s = []
ans = []
for i in range(t):
	s.append([i for i in map(int, input().split())])
for i in range(t):
	if ((s[i][0] - 1) ** 2) ** 0.5 < ((s[i][1] - s[i][2]) ** 2) ** 0.5 + ((s[i][2] - 1) ** 2) ** 0.5:
		ans.append(1)
	elif ((s[i][0] - 1) ** 2) ** 0.5 > ((s[i][1] - s[i][2]) ** 2) ** 0.5 + ((s[i][2] - 1) ** 2) ** 0.5:
		ans.append(2)
	else:
		ans.append(3)
[print(ans[i]) for i in range(t)]


n = int(input())
for i in range(n):
	(a, b, c) = map(int, input().split())
	dist_1 = abs(a - 1)
	dist_2 = abs(b - c) + abs(c - 1)
	if dist_1 < dist_2:
		print('1')
	elif dist_1 > dist_2:
		print('2')
	else:
		print('3')


def fun(a, b, c):
	timea = a - 1
	if c > b:
		timeb = 2 * c - b - 1
	if c < b:
		timeb = b - 1
	if timea < timeb:
		return 1
	if timea == timeb:
		return 3
	else:
		return 2
t = int(input())
for tc in range(t):
	(a, b, c) = map(int, input().split())
	print(fun(a, b, c))


def check(a, b, c):
	temp = abs(b - c) + c
	if a < temp:
		return 1
	elif a > temp:
		return 2
	else:
		return 3
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	sec = check(a, b, c)
	print(sec)


def Favaku():
	for Z in range(int(input())):
		(a, b, c) = [int(i) for i in input().split()]
		ta = a - 1
		tbc = abs(c - b) + (c - 1)
		if ta < tbc:
			print(1)
		elif tbc < ta:
			print(2)
		else:
			print(3)
Favaku()


times = int(input())
for time in range(times):
	(a, b, c) = [int(x) for x in input().split()]
	if a - 1 > abs(b - c) + c - 1:
		print(2)
	elif a - 1 < abs(b - c) + c - 1:
		print(1)
	else:
		print(3)


def main():
	(a, b, c) = map(int, input().split())
	first = abs(a - 1)
	second = abs(b - c) + abs(c - 1)
	if first < second:
		return 1
	if second < first:
		return 2
	return 3
for _ in range(int(input())):
	print(main())