Read problem statements in [Russian] and [Mandarin Chinese].

Given the time control of a chess match as a + b, determine which format of chess out of the given 4 it belongs to. 

1) Bullet if a + b < 3  

2) Blitz if 3 ≤ a + b ≤ 10

3) Rapid if 11 ≤ a + b ≤ 60  

4) Classical if 60 < a + b

------ Input Format ------ 

- First line will contain T, number of testcases. Then the testcases follow.
- Each testcase contains a single line of input, two integers a, b.

------ Output Format ------ 

For each testcase, output in a single line, answer 1 for bullet, 2 for blitz, 3 for rapid, and 4 for classical format.

------ Constraints ------ 

$1 ≤ T ≤ 1100$
$1 ≤ a ≤ 100$
$0 ≤ b ≤ 10$

----- Sample Input 1 ------ 
4
1 0
4 1
100 0
20 5

----- Sample Output 1 ------ 
1
2
4
3
----- explanation 1 ------ 
TestCase $1$: Since $a + b = 1 < 3$, it belongs to bullet format.

TestCase $2$: Since $3 ≤ (a + b = 5) ≤ 10$, it belongs to blitz format.

Difficulty: EASY

Solutions:
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if a + b < 3:
		print('1')
	elif 11 <= a + b <= 60:
		print('3')
	elif 60 < a + b:
		print('4')
	else:
		print('2')


for t in range(int(input())):
	(a, b) = map(int, input().split())
	if a + b < 3:
		print(1)
	elif a + b >= 3 and a + b <= 10:
		print(2)
	elif a + b >= 11 and a + b <= 60:
		print(3)
	elif a + b > 60:
		print(4)


n = int(input())
for i in range(0, n):
	(x, y) = map(int, input().split())
	a = x + y
	if a < 3:
		print('1')
	elif 3 <= a <= 10:
		print('2')
	elif 11 <= a <= 60:
		print('3')
	else:
		print('4')


T = int(input())
for i in range(T):
	(A, B) = map(int, input().split())
	if A + B < 3:
		print('1')
	elif A + B <= 10 and A + B >= 3:
		print('2')
	elif A + B <= 60 and A + B >= 11:
		print('3')
	else:
		print('4')


for _ in range(int(input())):
	c = sum(list(map(int, input().split())))
	if c < 3:
		print(1)
	elif c >= 3 and c <= 10:
		print(2)
	elif c >= 11 and c <= 60:
		print(3)
	else:
		print(4)


for i in range(int(input())):
	(a1, b1) = map(int, input().split())
	if a1 + b1 < 3:
		print('1')
	elif a1 + b1 >= 3 and a1 + b1 <= 10:
		print('2')
	elif a1 + b1 >= 11 and a1 + b1 <= 60:
		print('3')
	else:
		print('4')


n = int(input())
for i in range(n):
	(x, y) = list(map(int, input().split()))
	if x + y < 3:
		print('1')
	elif x + y <= 10 and x + y >= 3:
		print('2')
	elif x + y <= 60 and x + y >= 11:
		print('3')
	else:
		print('4')


for i in range(int(input())):
	(a, b) = map(int, input().split())
	z = a + b
	if z < 3:
		print(1)
	elif z <= 10:
		print(2)
	elif z <= 60:
		print(3)
	else:
		print(4)


t = int(input())
while t:
	t -= 1
	(a, b) = map(int, input().split())
	if a + b < 3:
		print(1)
	elif a + b >= 3 and a + b <= 10:
		print(2)
	elif a + b >= 11 and a + b <= 60:
		print(3)
	else:
		print(4)


for i in range(int(input())):
	d = sum(list(map(int, input().split())))
	if d < 3:
		print(1)
	elif d >= 3 and d <= 10:
		print(2)
	elif d >= 11 and d <= 60:
		print(3)
	else:
		print(4)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	if n + k < 3:
		print(1)
	elif 3 <= n + k <= 10:
		print(2)
	elif 11 <= n + k <= 60:
		print(3)
	else:
		print(4)


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	c = a + b
	if c < 3:
		print(1)
	elif 3 <= c <= 10:
		print(2)
	elif 11 <= c <= 60:
		print(3)
	else:
		print(4)


import math

def solution():
	pass
T = int(input())
for _ in range(T):
	(a, b) = map(int, input().split())
	if a + b < 3:
		print(1)
	elif 3 <= a + b <= 10:
		print(2)
	elif 11 <= a + b <= 60:
		print(3)
	else:
		print(4)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	l = 1 if a + b < 3 else 2 if a + b <= 10 else 3 if a + b <= 60 else 4
	print(l)


def code():
	cases = int(input())
	for _ in range(cases):
		(a, b) = map(int, input().split(' '))
		chess_format = 0
		time_control = a + b
		if time_control < 3:
			chess_format = 1
		if time_control <= 10 and time_control >= 3:
			chess_format = 2
		if time_control <= 60 and time_control >= 11:
			chess_format = 3
		if time_control > 60:
			chess_format = 4
		print(chess_format)
code()