Burenka and Tonya are playing an old Buryat game with a chip on a board of $n \times m$ cells.

At the beginning of the game, the chip is located in the lower left corner of the board. In one move, the player can move the chip to the right or up by any odd number of cells (but you cannot move the chip both to the right and up in one move). The one who cannot make a move loses.

Burenka makes the first move, the players take turns. Burenka really wants to win the game, but she is too lazy to come up with a strategy, so you are invited to solve the difficult task of finding it. Name the winner of the game (it is believed that Burenka and Tonya are masters of playing with chips, so they always move in the optimal way).

Chip's starting cell is green, the only cell from which chip can't move is red. if the chip is in the yellow cell, then blue cells are all options to move the chip in one move.


-----Input-----

The first line contains one integer $t$ ($1 \leq t \leq 10^4$) — the number of test cases. The following is a description of the input data sets.

The only line of each test case contains two integers $n$ and $m$ ($1 \leq n, m \leq 10^9$) — the dimensions of the game board.


-----Output-----

For each test case print a single line — the name of the winner of the game ("Burenka" or "Tonya").


-----Examples-----

Input
6
1 1
1 4
5 6
2 2
6 3
999999999 1000000000
Output
Tonya
Burenka
Burenka
Tonya
Burenka
Burenka


-----Note-----

In the first case, Burenka has no move, so Tonya wins.

In the second case, Burenka can move $3$ cells to the right, after which Tony will not be able to make a move, which means that Burenka wins.

In the third case, Burenka can move $5$ squares to the right. Then we can say that we have a game on a board of $1 \times 5$ cells, and Tonya is the first player. In such game the second player wins, so in the original one Burenka will win.

Difficulty: EASY
Tags: Game theory

Mathematics

Starter code:

Solutions:
for a in [*open(0)][1:]:
	print(('Tonya', 'Burenka')[sum(map(int, a.split())) % 2])


t = int(input())
ans = []
for e in range(t):
	(n, m) = map(int, input().split())
	if (n + m) % 2 == 0:
		ans.append('Tonya')
	else:
		ans.append('Burenka')
print('\n'.join(ans))


import sys
input = lambda : sys.stdin.readline().strip()
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if (a + b) % 2 == 0:
		print('Tonya')
	else:
		print('Burenka')


import sys
lines = []
for line in sys.stdin:
	lines.append(line.split())
for i in range(int(lines[0][0])):
	if (int(lines[i + 1][0]) - 1 + (int(lines[i + 1][1]) - 1)) % 2 == 0:
		print('Tonya')
	else:
		print('Burenka')


holder = []
a = int(input())
for i in range(a):
	b = input().split(' ')
	m = int(b[1])
	n = int(b[0])
	if (n + m) % 2 == 0:
		holder.append('Tonya')
	else:
		holder.append('Burenka')
for k in range(len(holder)):
	print(holder[k])


import sys
input = sys.stdin.readline
t = int(input())
s1 = 'Burenka'
s2 = 'Tonya'
for t_item in range(t):
	(n, m) = map(int, input().split())
	if n % 2 == 0:
		if m % 2 == 0:
			print(s2)
		else:
			print(s1)
	elif m % 2 == 0:
		print(s1)
	else:
		print(s2)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	if sum(map(int, input().split())) % 2 == 0:
		print('Tonya')
	else:
		print('Burenka')


B = 'Burenka'
T = 'Tonya'

def get_winner(n, m):
	if m % 2 == 0:
		if n % 2 == 0:
			return T
		else:
			return B
	elif n % 2 == 0:
		return B
	else:
		return T
t = int(input())
result = []
for i in range(t):
	(n, m) = [int(x) for x in input().split()]
	winner = get_winner(n, m)
	result.append(winner)
for winner in result:
	print(winner)


import sys
t = int(sys.stdin.readline())
for _ in range(t):
	(n, m) = map(int, sys.stdin.readline().split())
	if n % 2 == m % 2:
		print('Tonya')
	else:
		print('Burenka')


import sys
from sys import stdin, stdout
from math import ceil, floor, sqrt, log, log2, log10
from collections import Counter
int_max = float('inf')
int_min = -float('inf')
mod = 10 ** 9 + 7
ANS = []
input = stdin.readline

def solve():
	pass
t = int(input())
for i in range(t):
	(n, m) = map(int, input().split())
	if (n + m) % 2 == 0:
		print('Tonya')
	else:
		print('Burenka')


import sys
input = sys.stdin.readline

def solve():
	(n, m) = map(int, input().split())
	(r1, r2) = ((m - 1) % 2, (n - 1) % 2)
	return 'Burenka' if r1 != r2 else 'Tonya'
for _ in range(int(input())):
	print(solve())


def solve_one():
	(n, m) = map(int, input().split())
	return 'Burenka' if (n + m) % 2 == 1 else 'Tonya'

def solve():
	t = int(input())
	anss = []
	for _ in range(t):
		anss.append(solve_one())
	for ans in anss:
		print(ans)
solve()


n = int(input())
L = []
for i in range(n):
	(a, b) = map(int, input().split())
	if a == b:
		L.append('Tonya')
	elif (a + b) % 2 != 0:
		L.append('Burenka')
	else:
		L.append('Tonya')
for i in L:
	print(i)


l = []
a = int(input())
for i in range(a):
	count = 0
	(n, m) = map(int, input().split())
	if n % 2 == 1:
		count = count + 1
	if m % 2 == 1:
		count = count + 1
	if count % 2 == 0:
		l.append('Tonya')
	else:
		l.append('Burenka')
for i in l:
	print(i)


k = int(input())
ls = []
for i in range(1, k + 1):
	l = [int(elem) for elem in input().split()]
	ls.append(l)
for l in ls:
	if l[0] * l[1] % 2 == 1 or (l[0] % 2 == 0 and l[1] % 2 == 0):
		print('Tonya')
	else:
		print('Burenka')


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 calc_winner(num_of_rows, num_of_columns):
	if (num_of_rows + num_of_columns) % 2 == 0:
		return 'Tonya'
	return 'Burenka'
num_of_testcases = inp()
while num_of_testcases > 0:
	testcase = inlt()
	print(calc_winner(testcase[0], testcase[1]))
	num_of_testcases -= 1


inputs = []
outputs = []

def takeInput():
	n = input()
	for _ in range(int(n)):
		inp = input().split(' ')
		try:
			inputs.append([int(inp[0]), int(inp[1])])
		except e:
			inputs.append(inp)

def printOutput():
	for output in outputs:
		print(output)

def main():
	for testcase in inputs:
		n = testcase[0]
		m = testcase[1]
		if m % 2 == 0:
			if n % 2 == 0:
				outputs.append('Tonya')
			else:
				outputs.append('Burenka')
		elif n % 2 == 0:
			outputs.append('Burenka')
		else:
			outputs.append('Tonya')
takeInput()
main()
printOutput()


import sys
input = sys.stdin.readline
T = int(input())
for _ in range(T):
	(a, b) = map(int, input().split())
	if a % 2 == 0:
		if b % 2 == 1:
			print('Burenka')
		else:
			print('Tonya')
	elif b % 2 == 1:
		print('Tonya')
	else:
		print('Burenka')


import sys
input = iter(sys.stdin.read().splitlines()).__next__
TC = int(input())
for tc in range(TC):
	(n, m) = map(int, input().split())
	res = 'Burenka' if (n + m) % 2 == 1 else 'Tonya'
	print(res)


from collections import Counter
import string
import math
import bisect
import sys
from fractions import Fraction

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 = 10 ** 9 + 7
testcases = vary(1)
for _ in range(testcases):
	(n, m) = vary(2)
	if (n + m) % 2 == 0:
		print('Tonya')
	else:
		print('Burenka')


import sys
s = sys.stdin.read()
lines = s.split('\n')
for line in lines[1:-1]:
	(A, B) = [int(i) for i in line.split(' ')]
	total = A + B
	if total % 2 == 1:
		print('Burenka')
	else:
		print('Tonya')


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()):
	(n, m) = invr()
	a = n + m - 2
	if a % 2 == 0:
		print('Tonya')
	else:
		print('Burenka')


t = int(input())
res = []
for _ in range(t):
	(row, col) = [int(x) for x in input().split()]
	if row % 2 == 0 and col % 2 == 1:
		res.append('Burenka')
	elif row % 2 == 1 and col % 2 == 0:
		res.append('Burenka')
	else:
		res.append('Tonya')
for r in res:
	print(r)


res = []
for _ in range(int(input())):
	(n, m) = list(map(int, input().split()))
	if (n + m) % 2 == 0:
		res.append('Tonya')
	else:
		res.append('Burenka')
for r in res:
	print(r)


import sys
input = sys.stdin.readline

def int_num():
	return int(input())

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

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

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

def solve():
	(x, y) = int_list()
	ans = 'Tonya' if (x + y) % 2 == 0 else 'Burenka'
	print(ans)

def main():
	t = int_num()
	while t:
		solve()
		t -= 1
	return
main()


import sys
import math
from collections import Counter
from collections import defaultdict

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

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

def solve(n, m):
	if n % 2 == 0 and m % 2 == 0:
		return 'Tonya'
	if n % 2 != 0 and m % 2 != 0:
		return 'Tonya'
	return 'Burenka'
t = int(input())
for _ in range(t):
	arr = get_ints()
	print(solve(arr[0], arr[1]))


import os
import sys
from io import BytesIO, IOBase
from collections import Counter, defaultdict
from sys import stdin, stdout
import io
import math
import heapq
import bisect
import collections

def ceil(a, b):
	return (a + b - 1) // b
inf = float('inf')

def get():
	return stdin.readline().rstrip()
mod = 10 ** 5 + 7
for _ in range(int(get())):
	(n, m) = map(int, get().split())
	if n % 2 == 0 and m % 2 == 0:
		print('Tonya')
	elif n % 2 == 1 and m % 2 == 1:
		print('Tonya')
	else:
		print('Burenka')


ans_lst = []
for i in range(int(input())):
	(n, m) = map(int, input().split())
	if n % 2 == m % 2:
		ans_lst.append('Tonya')
	else:
		ans_lst.append('Burenka')
for i in ans_lst:
	print(i)


t = int(input())
lst = [None] * t
for i in range(0, t):
	lst1 = [int(i) for i in input().split()]
	if lst1[0] % 2 == 0 and lst1[1] % 2 == 0:
		lst[i] = 'Tonya'
	elif lst1[0] % 2 != 0 and lst1[1] % 2 != 0:
		lst[i] = 'Tonya'
	else:
		lst[i] = 'Burenka'
for i in lst:
	print(i)


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())
testCases = inp()
out = 1
for i in range(testCases):
	test = invr()
	test = list(test)
	if test[0] == 1 and test[1] == 1:
		out = 2
	elif test[0] == 1 and test[1] % 2 == 0:
		out = 1
	elif test[1] == 1 and test[0] % 2 == 0:
		out = 1
	elif test[0] % 2 != 0 and test[1] % 2 == 0:
		out = 1
	elif test[0] % 2 != 0 and test[1] % 2 != 0:
		out = 2
	elif test[0] % 2 == 0 and test[1] % 2 == 0:
		out = 2
	elif test[0] % 2 == 0 and test[1] % 2 != 0:
		out = 1
	else:
		out = 1
	if out == 2:
		print('Tonya')
	else:
		print('Burenka')


t = int(input())
winners = []
for i in range(t):
	(n, m) = [int(j) for j in input().split()]
	if (n + m) % 2:
		winners.append('Burenka')
	else:
		winners.append('Tonya')
for i in winners:
	print(i)


no = input()
tas = []
for i in range(int(no)):
	tas.append(input())
for i in tas:
	(a, b) = i.split()
	a = int(a)
	b = int(b)
	if a % 2 == 0 and b % 2 == 0 or (a % 2 != 0 and b % 2 != 0):
		print('Tonya')
	else:
		print('Burenka')


def func(p):
	row = p[0]
	col = p[1]
	if row == 1 and col == 1:
		print('Tonya')
	else:
		if row % 2 == 0 and col % 2 == 0:
			print('Tonya')
		if row % 2 != 0 and col % 2 != 0:
			print('Tonya')
		if row % 2 == 0 and col % 2 != 0 or (row % 2 != 0 and col % 2 == 0):
			print('Burenka')
t = int(input())
lst = []
for i in range(t):
	(x, y) = map(int, input().split())
	k = (x, y)
	lst.append(k)
for o in lst:
	func(o)


def game(r, c):
	if r == 1 and c == 1:
		print('Tonya')
		return
	if r % 2 == c % 2:
		print('Tonya')
		return
	else:
		print('Burenka')
num_of_tests = input()
tests = []
for i in range(int(num_of_tests)):
	tests.append(list(map(lambda x: int(x), input().split(' '))))
for i in tests:
	game(i[0], i[1])


from sys import stdin, stdout

def ans():
	(n, m) = map(int, stdin.readline().strip().split())
	if n % 2 == 0 and m % 2 == 0 or (n % 2 != 0 and m % 2 != 0):
		print('Tonya')
	else:
		print('Burenka')
t = int(stdin.readline())
for _ in range(t):
	ans()


a = int(input())
liste1 = []
liste2 = []
s = 0
for h in range(a):
	(b, c) = input().split()
	b = int(b)
	c = int(c)
	liste1.append(b)
	liste2.append(c)
for x in range(a):
	s = liste1[x] + liste2[x] - 2
	if s == 0 or s % 2 == 0:
		print('Tonya')
		s = 0
	elif s % 2 == 1:
		print('Burenka')
		s = 0


m = int(input())
list_0 = []
for i in range(m):
	(temp_a, temp_b) = input().split(' ')
	a = int(temp_a)
	b = int(temp_b)
	if (a + b) % 2 == 0:
		list_0.append('Tonya')
	else:
		list_0.append('Burenka')
for i in range(m):
	print(list_0[i])


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):
	pass
for _ in range(int(input())):
	(a, b) = gi()
	if (a + b) % 2 == 0:
		print('Tonya')
	else:
		print('Burenka')


t = int(input())
i = 0
n = [1] * t
b = [1] * t
while i < t:
	n[i] = [int(x) for x in input().split(' ', 2)]
	if n[i][0] % 2 == 0 and n[i][1] % 2 == 1 or (n[i][1] % 2 == 0 and n[i][0] % 2 == 1):
		b[i] = 'Burenka'
	else:
		b[i] = 'Tonya'
	i += 1
u = 0
while u < t:
	print(b[u])
	u += 1


num_entries = int(input())
results = []
for i in range(num_entries):
	results.append(sum([int(dimension) for dimension in input().split()]))
for result in results:
	if result % 2 == 1:
		print('Burenka')
	else:
		print('Tonya')


numtests = int(input())
cases = []
for x in range(numtests):
	cases.append([int(y) for y in input().split()])
c = 0
while numtests:
	numtests -= 1
	win1 = cases[c][0] % 2 != 0 and cases[c][1] % 2 == 0
	win2 = cases[c][1] % 2 != 0 and cases[c][0] % 2 == 0
	burwin = win1 or win2
	if win1 or win2:
		print('Burenka')
	else:
		print('Tonya')
	c += 1


import sys
import collections
import bisect
import math
from functools import lru_cache
for _ in range(int(input())):
	(n, k) = list(map(int, sys.stdin.readline().split()))
	if n % 2 == k % 2:
		print('Tonya')
	else:
		print('Burenka')


for s in [*open(0)][1:]:
	print('BTuorneynak a'[sum(map(int, s.split())) & 1 ^ 1::2])


def ans(n, m):
	if (m + n) % 2 == 0:
		return 'Tonya'
	else:
		return 'Burenka'
T = int(input())
r = []
for _ in range(T):
	(n, m) = map(int, input().split())
	c = ans(n, m)
	r.append(c)
for i in range(T):
	print(r[i])


t = int(input())
ans = [''] * t
for i in range(0, t):
	(n, m) = map(int, input().split())
	if n % 2 == 0 and m % 2 == 0:
		ans[i] = 'Tonya'
	if n % 2 != 0 and m % 2 != 0:
		ans[i] = 'Tonya'
	if n % 2 == 0 and m % 2 != 0:
		ans[i] = 'Burenka'
	if n % 2 != 0 and m % 2 == 0:
		ans[i] = 'Burenka'
for i in range(0, t):
	print(ans[i])


T = int(input())
q = []
for i in range(T):
	x = input().split()
	(n, m) = (int(x[0]), int(x[1]))
	q.append((n, m))

def solve(n, m):
	if n & 1 and m & 1:
		print('Tonya')
		return
	if n & 1 or m & 1:
		print('Burenka')
	else:
		print('Tonya')
for (n, m) in q:
	solve(n, m)


t = int(input())
l1 = []
for i in range(t):
	(n, m) = input().split()
	n = int(n)
	m = int(m)
	if n % 2 == 0 and m % 2 != 0:
		l1.append('Burenka')
	elif n % 2 != 0 and m % 2 == 0:
		l1.append('Burenka')
	elif n % 2 == 0 and m % 2 == 0:
		l1.append('Tonya')
	elif n % 2 != 0 and m % 2 != 0:
		l1.append('Tonya')
for i in l1:
	print(i)


n = int(input())
ans = []
for i in range(n):
	q = input()
	ql = q.split()
	ql[0] = int(ql[0])
	ql[1] = int(ql[1])
	if ql[0] % 2 == 0 and ql[1] % 2 == 0 or (ql[0] % 2 != 0 and ql[1] % 2 != 0):
		ans.append('Tonya')
	else:
		ans.append('Burenka')
for j in ans:
	print(j)


t = int(input())
input1 = []
output = []
for i in range(t):
	[n, m] = [int(item) for item in input().split()]
	input1.append([n, m])
for i in input1:
	n = i[0]
	m = i[1]
	start = 'Burenka'
	if m % 2 == 0:
		if n % 2 == 0:
			start = 'Tonya'
		else:
			start = 'Burenka'
	elif n % 2 == 0:
		start = 'Burenka'
	else:
		start = 'Tonya'
	output.append(start)
for i in output:
	print(i)


t = int(input())
results = []
for i in range(t):
	s = input().split(' ')
	n = s[0]
	m = s[1]
	counter = 0
	counter += int(n) % 2
	counter += int(m) % 2
	if counter % 2 == 0:
		results.append('Tonya')
	else:
		results.append('Burenka')
for i in results:
	print(i)


t = int(input())
ans = []
for _ in range(t):
	(n, m) = tuple(map(int, input().split()))
	if (n + m) % 2 == 0:
		ans.append('Tonya')
	else:
		ans.append('Burenka')
for i in ans:
	print(i)


t = int(input())
answers = []
for i in range(t):
	(n, m) = [int(i) for i in input().split()]
	(x, y) = (False, False)
	if n >= m:
		x = True
	elif m > n:
		y = True
	pos = [1, 1]
	turn = 0
	while True:
		turn += 1
		if [m, n] == [1, 1]:
			turn += 1
		if y:
			furthest = m - pos[1]
			if furthest % 2 == 1:
				pos[1] += furthest
			else:
				pos[1] += furthest - 1
			if pos[1] == m:
				if pos[0] == n:
					break
				y = False
				x = True
				continue
		if x:
			furthest = n - pos[0]
			if furthest % 2 == 1:
				pos[0] += furthest
			else:
				pos[0] += furthest - 1
			if pos[0] == n:
				if pos[1] == m:
					break
				y = True
				x = False
	if turn % 2 == 1:
		answers.append('Burenka')
	else:
		answers.append('Tonya')
for i in answers:
	print(i)


n = int(input())
list_of_winners = []
for i in range(0, n):
	a = input()
	a = a.split()
	n1 = int(a[0])
	m1 = int(a[1])
	if n1 % 2 == 0 and m1 % 2 != 0:
		list_of_winners.append('Burenka')
	elif n1 % 2 != 0 and m1 % 2 == 0:
		list_of_winners.append('Burenka')
	elif n1 % 2 == 0 and m1 % 2 == 0:
		list_of_winners.append('Tonya')
	elif n1 % 2 != 0 and m1 % 2 != 0:
		list_of_winners.append('Tonya')
for i in list_of_winners:
	print(i)


t = int(input())
l = []
for i in range(t):
	s = list(map(int, input().split()))
	l.append(s)
for i in range(t):
	if l[i][0] % 2 == 0:
		if l[i][1] % 2 == 0:
			print('Tonya')
		if l[i][1] % 2 != 0:
			print('Burenka')
	if l[i][0] % 2 != 0:
		if l[i][1] % 2 == 0:
			print('Burenka')
		if l[i][1] % 2 != 0:
			print('Tonya')


cases = int(input())
h = 0
while h < cases:
	board = input().split()
	if (int(board[0]) + int(board[1])) % 2 == 0:
		print('Tonya')
	else:
		print('Burenka')
	h += 1


def solve():
	n = int(input())
	for _ in range(n):
		[x, m] = list(map(int, input().split()))
		vals = ['Tonya', 'Burenka']
		print(vals[(x + m) % 2])
solve()


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	turns = (n + m) % 2
	print('Burenka' if turns == 1 else 'Tonya')


t = int(input())
for i in range(t):
	(n, m) = map(int, input().split())
	if (n + m) % 2:
		print('Burenka')
	else:
		print('Tonya')


def solve():
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	a -= 1
	b -= 1
	a = (a % 2 + b % 2) % 2
	if a == 0:
		print('Tonya')
	else:
		print('Burenka')

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


for i in range(int(input())):
	(n, m) = map(int, input().split())
	if n == 1 and m == 1:
		print('Tonya')
	elif n % 2 == 0 and m % 2 == 0:
		print('Tonya')
	elif n % 2 == 1 and m % 2 == 1:
		print('Tonya')
	else:
		print('Burenka')


for i in range(int(input())):
	(a, b) = map(int, input().split())
	if a % 2 == b % 2:
		print('Tonya')
	else:
		print('Burenka')


def calculate(x, y):
	if (x + y) % 2 == 0:
		return 'Tonya'
	else:
		return 'Burenka'
t = int(input())
while t:
	z = input().split(' ')
	x = int(z[0])
	y = int(z[1])
	print(calculate(x, y))
	t = t - 1


x = ['Burenka', 'Tonya']
t = int(input())
for i in range(t):
	(i, j) = map(int, input().split())
	(i, j) = (i - 1, j - 1)
	if i % 2 ^ j % 2:
		print('Burenka')
	else:
		print('Tonya')


for num in range(int(input())):
	sum_dim = 0
	dim = input().split()
	for i in dim:
		sum_dim = sum_dim + int(i)
	if sum_dim % 2 == 0:
		print('Tonya')
	else:
		print('Burenka')


for _ in range(int(input())):
	(m, k) = map(int, input().split())
	if m % 2 == k % 2:
		print('Tonya')
	else:
		print('Burenka')


t = int(input())
for i in range(t):
	(n, m) = input().split()
	if int(n) % 2 == 0 and int(m) % 2 == 0 or (int(n) % 2 != 0 and int(m) % 2 != 0):
		print('Tonya')
	else:
		print('Burenka')


winner = ['Tonya', 'Burenka']
for _ in range(int(input())):
	print(winner[sum(map(int, input().split())) % 2])


def soltion(n, m):
	if (n + m) % 2 == 0:
		print('Tonya')
	else:
		print('Burenka')
q = int(input())
for _ in range(q):
	(n, m) = map(int, input().split())
	soltion(n, m)


def main():
	for _ in range(int(input())):
		(n, m) = input().split(' ')
		(n, m) = (int(n), int(m))
		movimientos = n + m - 2
		if movimientos % 2 == 0:
			print('Tonya')
		else:
			print('Burenka')
main()