Bears love candies and games involving eating them. Limak and Bob play the following game. Limak eats 1 candy, then Bob eats 2 candies, then Limak eats 3 candies, then Bob eats 4 candies, and so on. Once someone can't eat what he is supposed to eat, he loses.
Limak can eat at most A candies in total (otherwise he would become sick), while Bob can eat at most B candies in total.
Who will win the game?
Print "Limak" or "Bob" accordingly.

-----Input-----
The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows.
The only line of each test case contains two integers A and B denoting the maximum possible number of candies Limak can eat and the maximum possible number of candies Bob can eat respectively.

-----Output-----
For each test case, output a single line containing one string — the name of the winner ("Limak" or "Bob" without the quotes).

-----Constraints-----
- 1 ≤ T ≤ 1000
- 1 ≤ A, B ≤ 1000

-----Example-----
Input:
10
3 2
4 2
1 1
1 2
1 3
9 3
9 11
9 12
9 1000
8 11

Output:
Bob
Limak
Limak
Bob
Bob
Limak
Limak
Bob
Bob
Bob

-----Explanation-----
Test case 1. We have A = 3 and B = 2. Limak eats 1 candy first, and then Bob eats 2 candies. Then Limak is supposed to eat 3 candies but that would mean 1 + 3 = 4 candies in total. It's impossible because he can eat at most A candies, so he loses. Bob wins, and so we print "Bob".
Test case 2. Now we have A = 4 and B = 2. Limak eats 1 candy first, and then Bob eats 2 candies, then Limak eats 3 candies (he has 1 + 3 = 4 candies in total, which is allowed because it doesn't exceed A). Now Bob should eat 4 candies but he can't eat even a single one (he already ate 2 candies). Bob loses and Limak is the winner.
Test case 8. We have A = 9 and B = 12. The game looks as follows:
- Limak eats 1 candy.
- Bob eats 2 candies.
- Limak eats 3 candies (4 in total).
- Bob eats 4 candies (6 in total).
- Limak eats 5 candies (9 in total).
- Bob eats 6 candies (12 in total).
- Limak is supposed to eat 7 candies but he can't — that would exceed A. Bob wins.

Source: codechef | Difficulty: EASY
Tags: Implementation

Complete search


Solutions:
from math import sqrt
t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	if int(sqrt(a)) > int((-1 + sqrt(1 - 4 * -b)) / 2):
		print('Limak')
	else:
		print('Bob')


for i in range(int(input())):
	(a, b) = map(int, input().split())
	n = 0
	while True:
		if n % 2 == 1:
			a = a - n
			if a < 0:
				print('Bob')
				break
		else:
			b = b - n
			if b < 0:
				print('Limak')
				break
		n = n + 1


for i in range(int(input())):
	(a, b) = map(int, input().split())
	j = 1
	flag = 0
	for i in range(1, 1000):
		if flag == 0:
			a = a - j
			flag = 1
			j += 1
			if a < 0:
				print('Bob')
				break
		elif flag == 1:
			b = b - j
			flag = 0
			j += 1
			if b < 0:
				print('Limak')
				break


t = int(input())

def check():
	(n, m) = map(int, input().split())
	for i in range(1, 1000, 2):
		n = n - i
		if n < 0:
			return 'Bob'
		m = m - i - 1
		if m < 0:
			return 'Limak'
for i in range(t):
	print(check())


for j in range(int(input())):
	(l, b) = map(int, input().split())
	c = 0
	i = 1
	while l > -1 and b > -1:
		if c == 0:
			l = l - i
			i = i + 1
			c = 1
		else:
			b = b - i
			i = i + 1
			c = 0
	if l < 0:
		print('Bob')
	else:
		print('Limak')


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	sum1 = 0
	sum2 = 0
	i = 1
	while True:
		sum1 = sum1 + i
		sum2 = sum2 + (i + 1)
		if sum1 > a:
			print('Bob')
			break
		if sum2 > b:
			print('Limak')
			break
		i = i + 2


n = int(input())
for i in range(n):
	l = [int(x) for x in input().split()]
	a = l[0]
	b = l[1]
	for i in range(1, 1000):
		if i % 2 != 0:
			a = a - i
			if a < 0:
				print('Bob')
				break
		elif i % 2 == 0:
			b = b - i
			if b < 0:
				print('Limak')
				break


a = int(input())
while a:
	a = a - 1
	(b, c) = list(map(int, input().split()))
	l = 0
	t = 0
	k = 1
	h = 2
	while 1:
		if l + k > b:
			print('Bob')
			break
		elif t + h > c:
			print('Limak')
			break
		else:
			l = l + k
			t = t + h
			k = k + 2
			h = h + 2


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	for i in range(1, 1000 + 1):
		if i % 2 == 1:
			a -= i
			if a < 0:
				print('Bob')
				break
		else:
			b -= i
			if b < 0:
				print('Limak')
				break


for t in range(int(input())):
	(A, B) = map(int, input().split())
	a = 0
	b = 0
	i = 1
	while True:
		if i % 2 == 1:
			a += i
		else:
			b += i
		i += 1
		if a > A:
			print('Bob')
			break
		if b > B:
			print('Limak')
			break


import math
for _ in range(int(input())):
	(A, B) = map(int, input().split(' '))
	c = 0
	d = 0
	sum = 0
	sum1 = 0
	for n in range(1, A + 1, 2):
		sum += n
		if sum <= A:
			c += 1
	for m in range(2, B + 1, 2):
		sum1 += m
		if sum1 <= B:
			d += 1
	if c > d:
		print('Limak')
	else:
		print('Bob')


for t in range(int(input())):
	(a, b) = map(int, input().split())
	for i in range(1, 501, 2):
		a -= i
		if a < 0:
			print('Bob')
			break
		b -= i + 1
		if b < 0:
			print('Limak')
			break


t = int(input())
for i in range(t):
	(x, y) = map(int, input().split())
	a = 1
	b = 2
	while x >= 0 and y >= 0:
		if x - a >= 0:
			x -= a
			a += 2
		else:
			print('Bob')
			break
		if y - b >= 0:
			y -= b
			b += 2
		else:
			print('Limak')
			break


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	for j in range(1, 1001):
		if j % 2 != 0:
			a -= j
			if a < 0:
				print('Bob')
				break
		else:
			b -= j
			if b < 0:
				print('Limak')
				break


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	limak_candies = 0
	bob_candies = 0
	for round in range(1, 1001):
		if round % 2 == 1:
			candies_to_eat = round
			if limak_candies + candies_to_eat > a:
				print('Bob')
				break
			else:
				limak_candies += candies_to_eat
		else:
			candies_to_eat = round
			if bob_candies + candies_to_eat > b:
				print('Limak')
				break
			else:
				bob_candies += candies_to_eat


t = int(input())
for i in range(t):
	(lim, bob) = map(int, input().split())
	limc = 0
	bobc = 0
	for round in range(1, 1001):
		if round % 2 == 1:
			l = round
			if limc + l > lim:
				print('Bob')
				break
			else:
				limc = limc + l
		else:
			l = round
			if bobc + l > bob:
				print('Limak')
				break
			else:
				bobc = bobc + l


t = int(input())
i = 0
while i < t:
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	ai = 1
	ae = 1
	bi = 2
	be = 2
	while True:
		if ae <= a:
			ai += 2
			ae += ai
		else:
			print('Bob')
			break
		if be <= b:
			bi += 2
			be += bi
		else:
			print('Limak')
			break
	i += 1


l = [i for i in range(1, 1000)]
for j in range(2, len(l)):
	l[j] = l[j] + l[j - 2]
for _ in range(int(input())):
	il = input().split() * 500
	for k in range(1000):
		if int(il[k]) >= l[k]:
			pass
		elif k % 2 == 0:
			print('Bob')
			break
		else:
			print('Limak')
			break


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	temp1 = a
	temp2 = b
	i = 1
	while a >= 0 and b >= 0:
		a = a - i
		b = b - (i + 1)
		i = i + 2
	if a < 0:
		print('Bob')
	elif b < 0:
		print('Limak')


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

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

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
abc = 'abcdefghijklmnopqrstuvwxyz'
pi = 3.141592653589793
t = int(input())
for _ in range(t):
	(a, b) = list(map(int, input().split()))
	i = 1
	while 1:
		a = a - i
		if a < 0:
			flag = False
			break
		i = i + 1
		b = b - i
		if b < 0:
			flag = True
			break
		i = i + 1
	if not flag:
		print('Bob')
	else:
		print('Limak')


for i in range(int(input())):
	(l, b) = map(int, input().split())
	for i in range(1, 1000):
		if i % 2 != 0:
			l = l - i
			if l < 0:
				print('Bob')
				break
		else:
			b = b - i
			if b < 0:
				print('Limak')
				break


import math
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	i = 1
	c = 0
	d = 0
	while c <= a and d <= b:
		c += i
		i += 1
		d += i
		i += 1
	if c > a:
		print('Bob')
	else:
		print('Limak')


t = int(input())
for i in range(t):
	(a, b) = list(map(int, input().split()))
	m = 1
	n = 2
	while 1:
		if a < m:
			print('Bob')
			break
		elif b < n:
			print('Limak')
			break
		a = a - m
		b = b - n
		m = m + 2
		n = n + 2


t = int(input())
for ts in range(t):
	(x, y) = map(int, input().split())
	a = 1
	b = 2
	while 1:
		if x < a:
			print('Bob')
			break
		elif y < b:
			print('Limak')
			break
		x -= a
		y -= b
		a += 2
		b += 2


t = int(input())
for i in range(t):
	(n1, n2) = map(int, input().split())
	b = 0
	l = 0
	c = 1
	while 1:
		if c % 2 == 0:
			l = l + c
		else:
			b = b + c
		if b > n1:
			print('Bob')
			break
		elif l > n2:
			print('Limak')
			break
		c = c + 1


n = int(input())
for i in range(0, n):
	(l, b) = map(int, input().split(' '))
	lcandie = 0
	bcandie = 0
	for a in range(1, 1000):
		if a % 2 == 1:
			lcandie += a
			if lcandie > l:
				print('Bob')
				break
		else:
			bcandie += a
			if bcandie > b:
				print('Limak')
				break


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	(li, bo, c) = (0, 0, 0)
	while li <= a and bo <= b:
		c += 1
		li += c
		c += 1
		bo += c
	if li > a:
		print('Bob')
	elif bo > b:
		print('Limak')


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	(limak, bob) = (0, 0)
	i = 1
	while True:
		if i % 2 == 1:
			if limak <= a:
				limak += i
			else:
				print('Bob')
				break
		elif bob <= b:
			bob += i
		else:
			print('Limak')
			break
		i += 1


def fun(l, b, m, n):
	if l > m:
		return 'Bob'
	elif b > n:
		return 'Limak'
	else:
		return 'again'
for _ in range(int(input())):
	(m, n) = map(int, input().split())
	(l, b) = (1, 2)
	(g, f) = (l, b)
	d = fun(l, b, m, n)
	if d != 'again':
		print(d)
	else:
		while d == 'again':
			l = b + 1
			b = l + 1
			g = l + g
			f = b + f
			d = fun(g, f, m, n)
		print(d)


for _ in range(int(input())):
	(Limak, Bob) = map(int, input().split())
	limak_candies = 0
	bob_candies = 0
	number = 1
	while True:
		limak_candies += number
		if limak_candies <= Limak:
			pass
		else:
			print('Bob')
			break
		bob_candies += number + 1
		if bob_candies <= Bob:
			pass
		else:
			print('Limak')
			break
		number += 2


for _ in range(int(input())):
	(L, B) = map(int, input().split())
	i = 1
	while True:
		if i % 2 == 0:
			B = B - i
			if B < 0:
				print('Limak ')
				break
		else:
			L = L - i
			if L < 0:
				print('Bob')
				break
		i = i + 1


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	Limak = 1
	Limak_to = Limak
	Bob = 2
	Bob_to = Bob
	while True:
		if Limak_to > a or Bob_to > b:
			if Limak_to > a:
				print('Bob')
				break
			elif Bob_to > b:
				print('Limak')
				break
		Limak += 2
		Limak_to += Limak
		Bob += 2
		Bob_to += Bob


Test = int(input())
for Cases in range(Test):
	(Limak, Bob) = map(int, input().split())
	LimakNew = BobNew = 0
	for Candies in range(1, 1000):
		if Candies % 2 == 0:
			BobNew += Candies
			if BobNew > Bob:
				print('Limak')
				break
		else:
			LimakNew += Candies
			if LimakNew > Limak:
				print('Bob')
				break


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	x = 1
	while 1:
		if x % 2 == 1 and a >= x:
			winner = 'Limak'
			a = a - x
			x += 1
			continue
		elif x % 2 == 0 and b >= x:
			winner = 'Bob'
			b = b - x
			x += 1
			continue
		break
	print(winner)


for i in range(int(input())):
	(a, b) = map(int, input().split())
	s = 0
	for d1 in range(1, 1000):
		if d1 % 2 != 0:
			if a >= 0:
				a -= d1
			else:
				print('Bob')
				break
		elif b >= 0:
			b -= d1
		else:
			print('Limak')
			break


for _ in range(int(input())):
	(l, b) = map(int, input().split())
	(turnl, turnb, c) = (1, 0, 1)
	while l >= 0 and b >= 0:
		if c % 2 == 1 and turnl:
			l -= c
			turnb = 1
			turnl = 0
		else:
			b -= c
			turnb = 0
			turnl = 1
		c += 1
	if turnb:
		print('Bob')
	else:
		print('Limak')


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	suma = 0
	sumb = 0
	n = 0
	while 1:
		suma = suma + 2 * n + 1
		if suma > a:
			print('Bob')
			break
		sumb = sumb + 2 * n + 2
		n += 1
		if sumb > b:
			print('Limak')
			break


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	(li, bo, c) = (0, 0, 0)
	while li <= x and bo <= y:
		c += 1
		li += c
		c += 1
		bo += c
	if li > x:
		print('Bob')
	elif bo > y:
		print('Limak')


for _ in range(int(input())):
	(lm, bm) = map(int, input().split())
	(l, b) = [0, 0]
	for x in range(1, 100):
		if x % 2 != 0 and lm >= l + x:
			l = l + x
		elif x % 2 == 0 and bm >= b + x:
			b = b + x
		else:
			break
	print('Limak' if l > b else 'Bob')


for i in range(int(input())):
	(a, b) = map(int, input().split())
	c = 0
	for j in range(1, 1000):
		if j % 2 == 0:
			b = b - j
			if b < 0:
				print('Limak')
				break
		else:
			a = a - j
			if a < 0:
				print('Bob')
				break


for test in range(int(input())):
	(a, b) = map(int, input().split())
	(sum1, sum2) = (0, 0)
	(p, q) = (1, 2)
	turn = 1
	while True:
		if turn == 1:
			sum1 += p
			p += 2
			if sum1 > a:
				print('Bob')
				break
			turn = 2
		else:
			sum2 += q
			q += 2
			if sum2 > b:
				print('Limak')
				break
			turn = 1


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	l = 1
	m = 2
	flag = 0
	n = 3
	while l <= a and m <= b:
		if flag == 0:
			l = l + n
			flag = 1
			n = n + 1
		else:
			m = m + n
			flag = 0
			n = n + 1
	if l > a:
		print('Bob')
	else:
		print('Limak')


t = int(input())
for i in range(t):
	(a, b) = list(map(int, input().split()))
	n = 1
	m = 2
	k = 0
	l = 0
	while n <= a:
		k += 1
		a -= n
		n += 2
	while m <= b:
		l += 1
		b -= m
		m += 2
	if k == l:
		print('Bob')
	elif k < l:
		print('Bob')
	elif k > l:
		print('Limak')


T = int(input())
for i in range(T):
	(A, B) = map(int, input().split())
	s = True
	c = 1
	while True:
		if s:
			A -= c
			if A < 0:
				print('Bob')
				break
			c += 1
			s = False
		else:
			B -= c
			if B < 0:
				print('Limak')
				break
			c += 1
			s = True


t = int(input())
while t:
	ll = []
	lb = []
	cl = 0
	cb = 0
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	for i in range(1, a + 1, 2):
		ll.append(i)
		if sum(ll) > a:
			ll.remove(i)
			break
	for i in range(2, b + 1, 2):
		lb.append(i)
		if sum(lb) > b:
			lb.remove(i)
			break
	if len(ll) > len(lb):
		print('Limak')
	else:
		print('Bob')
	t = t - 1


for T in range(int(input())):
	(a, b) = list(map(int, input().split()))
	for i in range(1, 1000):
		if i % 2 == 1:
			a = a - i
			if a < 0:
				print('Bob')
				break
		else:
			b = b - i
			if b < 0:
				print('Limak')
				break


for i in range(int(input())):
	(a, b) = map(int, input().split())
	turn = 0
	can = 1
	case = True
	while case:
		if turn % 2 == 0:
			if a >= can:
				a -= can
				can += 1
				turn += 1
			else:
				print('Bob')
				case = False
		elif b >= can:
			b -= can
			can += 1
			turn += 1
		else:
			print('Limak')
			case = False


Test = int(input())
for Cases in range(Test):
	(Limak, Bob) = map(int, input().split())
	Maximum = max(Limak, Bob)
	for Candies in range(1, 1000):
		if Candies % 2 == 1:
			Limak = Limak - Candies
			if Limak < 0:
				print('Bob')
				break
		else:
			Bob = Bob - Candies
			if Bob < 0:
				print('Limak')
				break


t = int(input())
for i in range(t):
	(l, b) = map(int, input().split())
	ch = 1
	i = 1
	while ch:
		if i % 2 == 1:
			l = l - i
			i += 1
			if l < 0:
				print('Bob')
				ch = 0
		else:
			b = b - i
			i += 1
			if b < 0:
				print('Limak')
				ch = 0


T = int(input())
for t in range(T):
	n = 1
	b = 0
	l = 0
	(llimit, blimit) = input().split()
	blimit = int(blimit)
	llimit = int(llimit)
	while True:
		if n % 2 == 0:
			if b + n <= blimit:
				b += n
				n += 1
			else:
				print('Limak')
				break
		elif l + n <= llimit:
			l += n
			n += 1
		else:
			print('Bob')
			break


t = int(input())
while t > 0:
	(l, b) = map(int, input().split(' '))
	li = bo = 0
	c = 1
	while True:
		li = li + c
		bo = bo + c + 1
		c += 2
		if li > l:
			print('Bob')
			break
		elif bo > b:
			print('Limak')
			break
	t -= 1


for _____cases_____ in range(int(input())):
	(A, B) = map(int, input().split())
	for i in range(1, 1000):
		if i % 2 == 1:
			A -= i
			if A < 0:
				print('Bob')
				break
		else:
			B -= i
			if B < 0:
				print('Limak')
				break


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	(a, b, c) = (0, 0, 0)
	while a <= x and b <= y:
		c += 1
		a += c
		c += 1
		b += c
	if a > x:
		print('Bob')
	elif b > y:
		print('Limak')


for _ in range(int(input())):
	(l, b) = map(int, input().split())
	c = 1
	d = 1
	while 1:
		if l < 0:
			print('Bob')
			break
		elif b < 0:
			print('Limak')
			break
		else:
			if c % 2 == 1:
				l = l - d
			else:
				b = b - d
			d += 1
		c += 1


n = int(input())
for i in range(n):
	k = list(map(int, input().split()))
	b = 0
	l = 0
	j = 1
	while 1:
		if j % 2 == 1:
			l = l + j
			if l <= k[0]:
				j = j + 1
			else:
				print('Bob')
				break
		if j % 2 == 0:
			b = b + j
			if b <= k[1]:
				j = j + 1
			else:
				print('Limak')
				break


def winner(a, b):
	(sumodd, sumeven) = (0, 0)
	even = 0
	if a >= 1 and a <= 1000 and (b <= 1000) and (b >= 1):
		for i in range(500):
			if sumodd > a:
				return 'Bob'
			if sumeven > b:
				return 'Limak'
			even += 2
			sumeven += even
			sumodd += even - 1
	else:
		print('Enter a valid value of a and b.')
T = int(input())
mylist = []
if T >= 1 and T <= 1000:
	for i in range(T):
		(a, b) = input().split(' ')
		mylist.append([int(a), int(b)])
else:
	print('Enter a valid limit')
for i in range(T):
	print(winner(mylist[i][0], mylist[i][1]))


for i in range(int(input())):
	(a, b) = map(int, input().split())
	e = 0
	x = 0
	c = 0
	while e <= a and x <= b:
		c += 1
		e += c
		c += 1
		x += c
	if e > a:
		print('Bob')
	elif x > b:
		print('Limak')


for i in range(int(input())):
	(a, b) = list(map(int, input().split()))
	(limak, bob) = (0, 0)
	winner = ''
	i = 1
	while i < 10000:
		if i % 2 != 0:
			limak += i
			if limak > a:
				winner = 'Bob'
				break
		else:
			bob += i
			if bob > b:
				winner = 'Limak'
				break
		i += 1
	print(winner)


for _ in range(int(input())):
	(a, b) = list(map(int, input().split()))
	l = b1 = 0
	for i in range(1, 1000, 2):
		l += i
		if l > a:
			print('Bob')
			break
		b1 = b1 + i + 1
		if b1 > b:
			print('Limak')
			break


for i in range(int(input())):
	(l, b) = [int(x) for x in input().split()]
	a = 0
	c = 0
	for i in range(1, l + 1, 2):
		a += i
		if a > l:
			a = a - i
			break
	for i in range(2, b + 1, 2):
		c += i
		if c > b:
			c = c - i
			break
	m = max(c, a)
	if m == c:
		print('Bob')
	else:
		print('Limak')


t = int(input())
for i in range(0, t):
	(a, b) = map(int, input().split())
	limaks = 0
	bobs = 0
	for i in range(1, 1001):
		if i % 2 != 0:
			limaks = limaks + i
			if limaks > a:
				print('Bob')
				break
		elif i % 2 == 0:
			bobs = bobs + i
			if bobs > b:
				print('Limak')
				break


for O in range(int(input())):
	(LA, BA) = map(int, input().split())
	(A, C) = (1, 0)
	while True:
		if LA >= A:
			LA -= A
			A += 1
			C += 1
		else:
			break
		if BA >= A:
			BA -= A
			A += 1
			C += 1
		else:
			break
	if C % 2 != 0:
		print('Limak')
	else:
		print('Bob')


from numpy import sqrt
t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	aMax = int(sqrt(a))
	bMax = int((-1 + sqrt(1 - 4 * -b)) / 2)
	if aMax > bMax:
		print('Limak')
	else:
		print('Bob')


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	li = bo = 0
	c = 1
	while True:
		li = li + c
		bo = bo + c + 1
		c += 2
		if li > a:
			print('Bob')
			break
		elif bo > b:
			print('Limak')
			break


for t in range(int(input())):
	(A, B) = [int(x) for x in input().split()]
	i = 1
	a = []
	b = []
	while i <= A + B:
		if i % 2 == 0:
			b.append(i)
			if sum(b) > B:
				print('Limak')
				break
		elif i % 2 != 0:
			a.append(i)
			if sum(a) > A:
				print('Bob')
				break
		i = i + 1


for t in range(int(input())):
	(limakMax, bobMax) = list(map(int, input().split()))
	limakEat = 0
	bobEat = 0
	eating = 1
	while limakEat <= limakMax or bobEat <= bobMax:
		if eating % 2 != 0 and limakEat <= limakMax:
			limakEat += eating
			eating += 1
			if limakEat > limakMax:
				print('Bob')
				break
		elif eating % 2 == 0 and bobEat <= bobMax:
			bobEat += eating
			eating += 1
			if bobEat > bobMax:
				print('Limak')
				break


tests = int(input())
for i in range(tests):
	candy = input().split()
	max_limak = int(candy[0])
	max_bob = int(candy[1])
	limak_list = []
	bob_list = []
	sum_limak = sum_bob = 0
	for i in range(1, max_limak + 1, 2):
		if sum_limak + i <= max_limak:
			limak_list.append(i)
			sum_limak = sum_limak + i
	for i in range(2, max_bob + 1, 2):
		if sum_bob + i <= max_bob:
			bob_list.append(i)
			sum_bob = sum_bob + i
	if len(limak_list) <= len(bob_list):
		print('Bob')
	else:
		print('Limak')