During their New Year holidays, Alice and Bob play the following game using an array $a$ of $n$ integers:

Players take turns, Alice moves first.

Each turn a player chooses any element and removes it from the array.

If Alice chooses even value, then she adds it to her score. If the chosen value is odd, Alice's score does not change.

Similarly, if Bob chooses odd value, then he adds it to his score. If the chosen value is even, then Bob's score does not change.

If there are no numbers left in the array, then the game ends. The player with the highest score wins. If the scores of the players are equal, then a draw is declared.

For example, if $n = 4$ and $a = [5, 2, 7, 3]$, then the game could go as follows (there are other options):

On the first move, Alice chooses $2$ and get two points. Her score is now $2$. The array $a$ is now $[5, 7, 3]$.

On the second move, Bob chooses $5$ and get five points. His score is now $5$. The array $a$ is now $[7, 3]$.

On the third move, Alice chooses $7$ and get no points. Her score is now $2$. The array $a$ is now $[3]$.

On the last move, Bob chooses $3$ and get three points. His score is now $8$. The array $a$ is empty now.

Since Bob has more points at the end of the game, he is the winner.

You want to find out who will win if both players play optimally. Note that there may be duplicate numbers in the array.


-----Input-----

The first line contains an integer $t$ ($1 \le t \le 10^4$) — the number of test cases. Then $t$ test cases follow.

The first line of each test case contains an integer $n$ ($1 \le n \le 2 \cdot 10^5$) — the number of elements in the array $a$.

The next line contains $n$ integers $a_1, a_2, \ldots, a_n$ ($1 \le a_i \le 10^9$) — the array $a$ used to play the game.

It is guaranteed that the sum of $n$ over all test cases does not exceed $2 \cdot 10^5$.


-----Output-----

For each test case, output on a separate line:

"Alice" if Alice wins with the optimal play;

"Bob" if Bob wins with the optimal play;

"Tie", if a tie is declared during the optimal play.


-----Examples-----

Input
4
4
5 2 7 3
3
3 2 1
4
2 2 2 2
2
7 8
Output
Bob
Tie
Alice
Alice


-----Note-----

None

Difficulty: EASY
Tags: Dynamic programming

Sorting

Game theory

Greedy algorithms
Skill types: Dynamic programming

Sorting

Greedy algorithms

Starter code:

Solutions:
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort(reverse=True)
	bob = alice = 0
	cur = 0
	for i in range(n):
		if cur == 0:
			if a[i] % 2 == 0:
				alice += a[i]
			cur = 1
		else:
			if a[i] % 2 == 1:
				bob += a[i]
			cur = 0
	if alice == bob:
		print('Tie')
	elif alice > bob:
		print('Alice')
	else:
		print('Bob')


t = int(input())
while t:
	t -= 1
	n = int(input())
	arr = map(int, input().split())
	arr = sorted(arr)
	alice = 0
	bob = 0
	alicekord = 1
	ctr = n - 1
	while ctr >= 0:
		if arr[ctr] % 2:
			if not alicekord:
				bob += arr[ctr]
		elif arr[ctr] % 2 == 0:
			if alicekord:
				alice += arr[ctr]
		alicekord = (alicekord + 1) % 2
		ctr -= 1
	if bob < alice:
		print('Alice')
	elif alice < bob:
		print('Bob')
	else:
		print('Tie')


for _ in range(int(input())):
	n = int(input())
	a = sorted(list(map(int, input().split())), reverse=True)
	Alice = sum([i if i % 2 == 0 else 0 for i in a[::2]])
	Bob = sum([i if i % 2 == 1 else 0 for i in a[1::2]])
	if Alice > Bob:
		print('Alice')
	elif Alice < Bob:
		print('Bob')
	else:
		print('Tie')


list_ans = []
for _ in range(int(input())):
	n = int(input())
	list1 = list(map(int, input().split()))
	(a, b) = (0, 0)
	(a1, b1) = (0, 0)
	list1.sort()
	while list1:
		a1 = list1.pop()
		if a1 % 2 == 0:
			a += a1
		if list1:
			b1 = list1.pop()
			if b1 % 2 == 1:
				b += b1
	if a > b:
		list_ans.append('Alice')
	elif a < b:
		list_ans.append('Bob')
	else:
		list_ans.append('Tie')
for item in list_ans:
	print(item)


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	alice = 0
	bob = 0
	turn = True
	while len(a) > 0:
		if turn:
			num = a.pop()
			if num % 2 == 0:
				alice += num
			turn = False
		else:
			num = a.pop()
			if num % 2 == 1:
				bob += num
			turn = True
	if alice > bob:
		print('Alice')
	elif bob > alice:
		print('Bob')
	else:
		print('Tie')


def chet(num):
	if num % 2 == 0:
		return True
	else:
		return False

def func():
	n = int(input())
	a = list(map(int, input().split()))
	a_s = sorted(a)[::-1]
	alice_count = 0
	for (nn, i) in enumerate(a_s):
		if chet(nn):
			if chet(i):
				alice_count += i
		elif chet(i) == False:
			alice_count -= i
	if alice_count > 0:
		print('Alice')
	elif alice_count < 0:
		print('Bob')
	else:
		print('Tie')
t = int(input())
for _ in range(t):
	func()


def update_even():
	global highest_even
	while (a[highest_even] % 2 == 1 or taken[highest_even]) and highest_even >= 0:
		highest_even -= 1

def update_odd():
	global highest_odd
	while (a[highest_odd] % 2 == 0 or taken[highest_odd]) and highest_odd >= 0:
		highest_odd -= 1
t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	taken = [False] * n
	a.sort()
	alice = 0
	bob = 0
	highest_odd = -1
	highest_even = -1
	for i in range(n - 1, -1, -1):
		if a[i] % 2 == 1:
			highest_odd = i
			break
	for i in range(n - 1, -1, -1):
		if a[i] % 2 == 0:
			highest_even = i
			break
	turn = False
	for _ in range(n):
		if turn == 0:
			if highest_even == -1:
				taken[highest_odd] = True
				update_odd()
			elif highest_odd == -1:
				taken[highest_even] = True
				alice += a[highest_even]
				update_even()
			elif a[highest_even] >= a[highest_odd]:
				taken[highest_even] = True
				alice += a[highest_even]
				update_even()
			else:
				taken[highest_odd] = True
				update_odd()
		elif highest_odd == -1:
			taken[highest_even] = True
			update_even()
		elif highest_even == -1:
			taken[highest_odd] = True
			bob += a[highest_odd]
			update_odd()
		elif a[highest_odd] >= a[highest_even]:
			taken[highest_odd] = True
			bob += a[highest_odd]
			update_odd()
		else:
			taken[highest_even] = True
			update_even()
		turn ^= True
	if alice > bob:
		print('Alice')
	elif alice < bob:
		print('Bob')
	else:
		print('Tie')


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort(reverse=True)
	a1 = 0
	b = 0
	for i in range(0, n, 2):
		if a[i] % 2 == 0:
			a1 += a[i]
		if i + 1 == n:
			break
		if a[i + 1] % 2 == 1:
			b += a[i + 1]
	if a1 > b:
		print('Alice')
	elif a1 < b:
		print('Bob')
	else:
		print('Tie')


for _ in range(int(input())):
	n = int(input())
	a = [int(i) for i in input().replace('\n', '').split(' ')]
	Alice = [0]
	Bob = [0]
	for i in a:
		if i % 2 == 0:
			Alice.append(i)
		else:
			Bob.append(i)
	Alice.sort(reverse=True)
	Bob.sort(reverse=True)
	aa = 0
	bb = 0
	ai = 0
	bi = 0
	while n > 0:
		if Alice[ai] >= Bob[bi]:
			aa += Alice[ai]
			ai += 1
		else:
			bi += 1
		n -= 1
		if n == 0:
			break
		if Alice[ai] <= Bob[bi]:
			bb += Bob[bi]
			bi += 1
		else:
			ai += 1
		n -= 1
	if aa > bb:
		print('Alice')
	elif bb > aa:
		print('Bob')
	elif aa == bb:
		print('Tie')


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort(reverse=True)
	ans = 0
	for i in range(n):
		if i % 2 == 0:
			if arr[i] % 2 == 0:
				ans += arr[i]
		elif arr[i] % 2 == 1:
			ans -= arr[i]
	if ans == 0:
		print('Tie')
	elif ans > 0:
		print('Alice')
	else:
		print('Bob')


import sys
input = sys.stdin.buffer.readline

def multiLineArrayPrint(arr):
	print('\n'.join([str(x) for x in arr]))
t = int(input())
allAns = []
for _ in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	a.sort()
	score = 0
	aliceNext = True
	for i in range(n - 1, -1, -1):
		if aliceNext and a[i] % 2 == 0:
			score += a[i]
		elif not aliceNext and a[i] % 2 == 1:
			score -= a[i]
		aliceNext = not aliceNext
	if score > 0:
		allAns.append('Alice')
	elif score == 0:
		allAns.append('Tie')
	else:
		allAns.append('Bob')
multiLineArrayPrint(allAns)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	even = []
	odd = []
	for x in a:
		if x % 2 == 0:
			even.append(x)
		else:
			odd.append(x)
	even.sort()
	odd.sort()
	alice = 0
	bob = 0
	for i in range(n):
		if i % 2 == 0:
			if len(even) > 0 and len(odd) > 0 and (even[-1] >= odd[-1]):
				alice += even[-1]
				even.pop()
			elif len(odd) == 0:
				alice += even[-1]
				even.pop()
			else:
				odd.pop()
		elif len(odd) > 0 and len(even) > 0 and (odd[-1] >= even[-1]):
			bob += odd[-1]
			odd.pop()
		elif len(even) == 0:
			bob += odd[-1]
			odd.pop()
		else:
			even.pop()
	if alice > bob:
		print('Alice')
	elif bob > alice:
		print('Bob')
	else:
		print('Tie')


T = int(input())
for _ in range(T):
	N = int(input())
	nums = list(map(int, input().split()))
	(odd, even) = ([], [])
	for n in nums:
		if n & 1:
			odd.append(n)
		else:
			even.append(n)
	odd.sort()
	even.sort()
	(a, b) = (0, 0)
	turn = 0
	while odd or even:
		if not odd:
			v = even.pop()
		elif not even:
			v = odd.pop()
		elif odd[-1] > even[-1]:
			v = odd.pop()
		else:
			v = even.pop()
		if turn == 0 and (not v & 1):
			a += v
		elif turn == 1 and v & 1:
			b += v
		turn = 1 - turn
	if a > b:
		print('Alice')
	elif a < b:
		print('Bob')
	else:
		print('Tie')


import math
from time import time
from collections import Counter, deque

def main():
	n = int(input())
	K = list(map(int, input().split()))
	A = deque(sorted(K, reverse=True))
	s1 = 0
	s2 = 0
	t = 1
	while len(A) != 0:
		if t == 1:
			if A[0] % 2 == 0:
				s1 += A[0]
		elif A[0] % 2 == 1:
			s2 += A[0]
		A.popleft()
		if t == 1:
			t = 2
		else:
			t = 1
	if s1 == s2:
		print('Tie')
	elif s1 > s2:
		print('Alice')
	else:
		print('Bob')
for i in range(int(input())):
	main()


for _ in range(int(input())):
	(n_rounds, score) = (int(input()), 0)
	vals = sorted(map(int, input().split()), reverse=True)
	for i in range(n_rounds):
		if i % 2 == 0:
			if vals[i] % 2 == 0:
				score += vals[i]
		elif vals[i] % 2 != 0:
			score -= vals[i]
	if score > 0:
		print('Alice')
	elif score < 0:
		print('Bob')
	else:
		print('Tie')


from collections import deque
t = int(input())
for ii in range(t):
	n = int(input())
	a = list(map(int, input().rstrip().split()))
	odd = []
	even = []
	for i in a:
		if i % 2 == 0:
			even.append(i)
		else:
			odd.append(i)
	odd.sort(reverse=True)
	even.sort(reverse=True)
	odd = deque(odd)
	even = deque(even)
	alice = 0
	bob = 0
	chance = 0
	while even and odd:
		if chance == 0:
			if odd[0] > even[0]:
				odd.popleft()
			else:
				alice += even.popleft()
			chance = 1
		else:
			if even[0] > odd[0]:
				even.popleft()
			else:
				bob += odd.popleft()
			chance = 0
	if len(even) > 0:
		if chance == 0:
			for i in range(len(even)):
				if i % 2 == 0:
					alice += even[i]
		if chance == 1:
			even.popleft()
			for i in range(len(even)):
				if i % 2 == 0:
					alice += even[i]
	elif len(odd) > 0:
		if chance == 0:
			odd.popleft()
			for i in range(len(odd)):
				if i % 2 == 0:
					bob += odd[i]
		if chance == 1:
			for i in range(len(odd)):
				if i % 2 == 0:
					bob += odd[i]
	if alice > bob:
		print('Alice')
	elif bob > alice:
		print('Bob')
	else:
		print('Tie')


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
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
import copy
import time
starttime = time.time()
mod = int(pow(10, 9) + 7)
mod2 = 998244353

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

def out(*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)]
try:
	sys.stdin = open('input.txt', 'r')
except:
	pass

def pmat(A):
	for ele in A:
		print(*ele, end='\n')
for _ in range(L()[0]):
	n = L()[0]
	A = L()
	oddsum = 0
	evensum = 0
	A.sort()
	for i in range(n):
		if i % 2 == 0:
			x = A.pop()
			evensum += 0 if x % 2 else x
		else:
			x = A.pop()
			oddsum += 0 if x % 2 == 0 else x
	if evensum > oddsum:
		print('Alice')
	elif evensum == oddsum:
		print('Tie')
	else:
		print('Bob')
endtime = time.time()


for _ in range(int(input())):
	n = int(input())
	data = list(map(int, input().split()))
	data.sort(reverse=True)
	alice = bob = 0
	for i in range(n):
		if data[i] % 2 and i % 2:
			bob += data[i]
		elif not data[i] % 2 and (not i % 2):
			alice += data[i]
	if alice > bob:
		print('Alice')
	elif bob > alice:
		print('Bob')
	else:
		print('Tie')


def evenOddGame(n, array):
	array.sort(reverse=True)
	allice = 0
	bob = 0
	for x in range(n):
		if x % 2 == 0 and array[x] % 2 == 0:
			allice += array[x]
		elif x % 2 == 1 and array[x] % 2 == 1:
			bob += array[x]
	if allice > bob:
		return 'Alice'
	elif bob > allice:
		return 'Bob'
	else:
		return 'Tie'
t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	print(evenOddGame(n, l))


t = int(input())
while t != 0:
	n = int(input())
	A = list(map(int, input().split()))
	score = 0
	A.sort(reverse=True)
	for i in range(n):
		if i % 2 == 0:
			if A[i] % 2 == 0:
				score += A[i]
			else:
				score += 0
		elif A[i] % 2 == 1:
			score -= A[i]
		else:
			score -= 0
	if score > 0:
		print('Alice')
	elif score < 0:
		print('Bob')
	else:
		print('Tie')
	t -= 1


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	w = sorted(map(int, input().split()), reverse=True)
	(A, B) = (0, 0)
	for i in range(0, n - 1, 2):
		if w[i] % 2 and w[i + 1] % 2:
			B += w[i + 1]
		elif w[i] % 2 == 0 and w[i + 1] % 2 == 0:
			A += w[i]
		elif w[i] % 2 == 0 and w[i + 1] % 2:
			A += w[i]
			B += w[i + 1]
	if n % 2 == 1:
		if w[-1] % 2 == 0:
			A += w[-1]
	print('Bob' if B > A else 'Alice' if A > B else 'Tie')


for _ in range(int(input())):
	n = int(input())
	A = sorted([int(x) for x in input().split()])
	A.reverse()
	a = sum([i for i in A[::2] if not i % 2])
	b = sum([i for i in A[1::2] if i % 2])
	if a > b:
		print('Alice')
	elif a < b:
		print('Bob')
	else:
		print('Tie')


for i in range(int(input())):
	n = int(input())
	a = sorted(list(map(int, input().split())), reverse=True)
	i = 0
	(al, bo) = (0, 0)
	while i < n:
		if a[i] % 2 == 0:
			al += a[i]
		i += 1
		if i < n and a[i] % 2 != 0:
			bo += a[i]
		i += 1
	if al > bo:
		print('Alice')
	elif al < bo:
		print('Bob')
	else:
		print('Tie')


t = int(input())
for _ in range(t):
	l = int(input())
	alice_score = 0
	bob_score = 0
	list1 = list(map(int, input().split()))
	list1.sort(reverse=True)
	for i in range(l):
		a = list1[i]
		if i % 2 == 0 and a % 2 == 0:
			alice_score = alice_score + a
		elif i % 2 == 1 and a % 2 == 1:
			bob_score = bob_score + a
	if alice_score == bob_score:
		print('Tie')
	elif alice_score > bob_score:
		print('Alice')
	else:
		print('Bob')


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')
t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	arr = [int(x) for x in input().split()]
	arr.sort()
	(a, b) = (0, 0)
	if n % 2 == 0:
		for i in range(n // 2):
			a1 = arr.pop()
			if a1 % 2 == 0:
				a += a1
			b1 = arr.pop()
			if b1 % 2 != 0:
				b += b1
	else:
		for i in range(n // 2):
			a1 = arr.pop()
			if a1 % 2 == 0:
				a += a1
			b1 = arr.pop()
			if b1 % 2 != 0:
				b += b1
		a1 = arr.pop()
		if a1 % 2 == 0:
			a += a1
	if a == b:
		print('Tie')
	elif a > b:
		print('Alice')
	else:
		print('Bob')


from heapq import heapify, heappop, heappush
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	even = []
	odd = []
	smEven = 0
	smOdd = 0
	for i in a:
		if i % 2 == 0:
			smEven += i
			even.append(i)
		else:
			smOdd += i
			odd.append(i)
	x = 0
	even.sort()
	odd.sort()
	for i in range(n):
		if even and odd:
			xx = even[-1]
			yy = odd[-1]
			mx = max(xx, yy)
			if i % 2 == 0:
				if mx == xx:
					even.pop()
					x += mx
				else:
					odd.pop()
			elif mx == xx:
				even.pop()
			else:
				odd.pop()
				x -= mx
			continue
		if i % 2:
			if not even:
				x -= odd.pop()
			else:
				even.pop()
		elif not odd:
			x += even.pop()
		else:
			odd.pop()
	res = 'Tie'
	if x > 0:
		res = 'Alice'
	elif x < 0:
		res = 'Bob'
	print(res)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	ans = 0
	flag = True
	for i in range(n):
		x = a.pop()
		if flag:
			if x % 2 == 0:
				ans += x
			flag = not flag
		else:
			if x % 2 != 0:
				ans -= x
			flag = not flag
	if ans == 0:
		print('Tie')
	elif ans > 0:
		print('Alice')
	else:
		print('Bob')


import sys

def solve(nums):
	a = b = 0
	nums.sort()
	while nums:
		n = nums.pop()
		a += n if n % 2 == 0 else 0
		if nums:
			n = nums.pop()
			b += n if n % 2 != 0 else 0
	return 'Alice' if a > b else 'Bob' if b > a else 'Tie'
t = int(sys.stdin.readline().rstrip())
for _ in range(t):
	_ = int(sys.stdin.readline().rstrip())
	nums = list(map(int, sys.stdin.readline().rstrip().split(' ')))
	print(solve(nums))


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort(reverse=True)
	ali = 0
	bob = 0
	for i in range(n):
		if i % 2 == 0:
			if a[i] % 2 == 0:
				ali += a[i]
			else:
				pass
		elif a[i] % 2 == 1:
			bob += a[i]
		else:
			pass
	if ali > bob:
		print('Alice')
	elif ali < bob:
		print('Bob')
	else:
		print('Tie')


for i in range(int(input())):
	n = int(input())
	arr = sorted(list(map(int, input().split())))
	result = 0
	for i in range(n):
		a = arr.pop()
		if i % 2 == 0:
			if a % 2 == 0:
				result += a
		elif a % 2 != 0:
			result -= a
	if result > 0:
		print('Alice')
	elif result < 0:
		print('Bob')
	else:
		print('Tie')


import math
for t in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort(reverse=True)
	esum = 0
	osum = 0
	for i in range(0, len(l), 2):
		if l[i] % 2 == 0:
			esum += l[i]
		j = i + 1
		if j < len(l):
			if l[j] % 2 != 0:
				osum += l[j]
	if esum == osum:
		print('Tie')
	elif esum > osum:
		print('Alice')
	else:
		print('Bob')


I = lambda : map(int, input().split())
for _ in [0] * int(input()):
	n = int(input())
	a = list(I())
	c = i = 0
	a.sort(reverse=1)
	for x in a:
		if i == 0 and x % 2 == 0:
			c = c + x
		elif i == 1 and x % 2 == 1:
			c = c - x
		i = 1 - i
	if c == 0:
		print('Tie')
	elif c > 0:
		print('Alice')
	else:
		print('Bob')


int_inp = lambda : int(input())
strng = lambda : input().strip()
strl = lambda : list(input().strip())
mul = lambda : map(int, input().strip().split())
mulf = lambda : map(float, input().strip().split())
seq = lambda : list(map(int, input().strip().split()))
import math
from collections import Counter, defaultdict
for _ in range(int_inp()):
	k = int_inp()
	m = seq()
	m.sort()
	alice = 0
	bob = 0
	while 1:
		try:
			if m[-1] % 2 == 0:
				alice = alice + m[-1]
			m.pop(-1)
			if m[-1] % 2 != 0:
				bob = bob + m[-1]
			m.pop(-1)
		except:
			break
	print(['Alice', 'Bob', 'Tie'][(bob > alice) + 2 * (bob == alice)])


import sys
input = sys.stdin.readline

def greater(a, b):
	return a > b
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort(reverse=True)
	ans = 0
	for i in range(n):
		if i % 2 == 0:
			if a[i] % 2 == 0:
				ans += a[i]
		elif a[i] % 2 == 1:
			ans -= a[i]
	if ans == 0:
		print('Tie')
	elif ans > 0:
		print('Alice')
	else:
		print('Bob')


for _ in range(int(input())):
	n = int(input())
	a = sorted(list(map(int, input().split())))[::-1]
	ar = a[::2]
	br = a[1::2]
	sum1 = 0
	sum2 = 0
	for i in range(len(ar)):
		if ar[i] % 2 == 0:
			sum1 += ar[i]
	for i in range(len(br)):
		if br[i] % 2:
			sum2 += br[i]
	if sum1 > sum2:
		print('Alice')
	elif sum1 < sum2:
		print('Bob')
	else:
		print('Tie')


nbtest = int(input())
for i in range(nbtest):
	n = input()
	numbers = [int(i) for i in input().split()]
	alice = 0
	bob = 0
	t = 0
	numbers.sort(reverse=True)
	for c in numbers:
		if c % 2 == 0 and t % 2 == 0:
			alice += c
		if c % 2 == 1 and t % 2 == 1:
			bob += c
		t += 1
	if alice > bob:
		print('Alice')
	elif bob > alice:
		print('Bob')
	else:
		print('Tie')


T = int(input())
for tc in range(T):
	n = int(input())
	array_a = list(map(int, input().split()))
	even = []
	odds = []
	numbers = []
	for i in range(n):
		if array_a[i] % 2 == 0:
			even.append(array_a[i])
		else:
			odds.append(array_a[i])
	even.sort()
	odds.sort()
	len_even = len(even)
	len_odds = n - len_even
	sum_more_even = 0
	sum_more_odds = 0
	flag_more_even = len_even > len_odds
	flag_more_odds = len_even < len_odds
	if flag_more_even:
		sum_more_even = sum(even[len_even - len_odds - 1:])
	elif flag_more_odds:
		sum_more_odds = sum(odds[len_odds - len_even - 1:])
	score_alice = 0
	score_bob = 0
	while len(even) > 0 or len(odds) > 0:
		if len(even) > 0 and len(odds) > 0:
			if even[-1] - odds[-1] > 0:
				score_alice += even[-1]
				even.pop()
				if len(even) > 0:
					if even[-1] - odds[-1] > 0:
						even.pop()
					else:
						score_bob += odds[-1]
						odds.pop()
				else:
					score_bob += odds[-1]
					odds.pop()
			else:
				odds.pop()
				if len(odds) > 0:
					if even[-1] - odds[-1] > 0:
						even.pop()
					else:
						score_bob += odds[-1]
						odds.pop()
				else:
					even.pop()
		elif len(even) > 0:
			score_alice += even[-1]
			even.pop()
			if len(even) > 0:
				even.pop()
			else:
				break
		elif len(odds) > 0:
			odds.pop()
			if len(odds) > 0:
				score_bob += odds[-1]
				odds.pop()
			else:
				break
		else:
			break
	if score_alice > score_bob:
		print('Alice')
	elif score_alice < score_bob:
		print('Bob')
	else:
		print('Tie')


import sys
input = sys.stdin.readline
T = int(input())
for _ in range(T):
	n = int(input())
	A = list(map(int, input().split()))
	EA = []
	EO = []
	for i in range(n):
		if A[i] % 2 == 0:
			EA.append(A[i])
		else:
			EO.append(A[i])
	EA.sort(reverse=True)
	EO.sort(reverse=True)
	n1 = len(EA)
	n2 = len(EO)
	i = 0
	j = 0
	bv = 0
	av = 0
	flag = 0
	while i != n1 and j != n2:
		if EA[i] > EO[j]:
			if flag == 0:
				av = av + EA[i]
			i = i + 1
		else:
			if flag == 1:
				bv = bv + EO[j]
			j = j + 1
		flag = (flag + 1) % 2
	if i == n1:
		while j < n2:
			if flag % 2 != 0:
				bv = bv + EO[j]
			j = j + 1
			flag = (flag + 1) % 2
	elif j == n2:
		while i < n1:
			if flag % 2 == 0:
				av = av + EA[i]
			i = i + 1
			flag = (flag + 1) % 2
	if av > bv:
		print('Alice')
	elif bv > av:
		print('Bob')
	else:
		print('Tie')


t = int(input())
c = []
for i in range(t):
	n = int(input())
	s = list(map(int, input().split()))
	s.sort()
	s = s[::-1]
	a = 0
	b = 0
	h = 0
	for j in s:
		if h == 0:
			a += j * (1 - j % 2)
			h = 1
		else:
			b += j * (j % 2)
			h = 0
	if a > b:
		c.append('Alice')
	elif a == b:
		c.append('Tie')
	else:
		c.append('Bob')
for i in c:
	print(i)


for k in range(int(input())):
	n = int(input())
	lst = list(map(int, input().split()))
	lst.sort(reverse=True)
	score = 0
	for (i, item) in enumerate(lst):
		if i % 2 == 0:
			if item & 1:
				pass
			else:
				score += item
		elif item & 1:
			score -= item
	if score > 0:
		print('Alice')
	elif score < 0:
		print('Bob')
	else:
		print('Tie')


from audioop import reverse

def solve(A):
	score = 0
	A.sort(reverse=True)
	for i in range(len(A)):
		if i % 2 == 0:
			if A[i] % 2 == 0:
				score += A[i]
		elif A[i] % 2 == 1:
			score -= A[i]
	if score > 0:
		return 'Alice'
	if score == 0:
		return 'Tie'
	return 'Bob'
t = int(input())
for _ in range(t):
	n = int(input())
	lst = list(map(int, input().split()))[:n]
	print(solve(lst))


import math
from collections import *
from functools import lru_cache
import bisect
from itertools import *
from heapq import *
inf = float('inf')
ninf = -float('inf')
ip = input
alpha = 'abcdefghijklmnopqrstuvwxyz'

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

def ipn():
	return int(input())

def ipf():
	return float(input())

def solve():
	n = ipn()
	a = sorted(ipl(), reverse=True)
	i = 0
	(al, bo) = (0, 0)
	while i < n:
		if a[i] % 2 == 0:
			al += a[i]
		i += 1
		if i < n and a[i] % 2 != 0:
			bo += a[i]
		i += 1
	if al > bo:
		print('Alice')
	elif al < bo:
		print('Bob')
	else:
		print('Tie')
for _ in range(int(input())):
	solve()


t = int(input())
while t > 0:
	n = int(input())
	l = list(map(int, input().split()))
	l.sort(reverse=True)
	alice = []
	bob = []
	for i in range(len(l)):
		if i % 2 == 0:
			if l[i] % 2 == 0:
				alice.append(l[i])
		elif i % 2 == 1:
			if l[i] % 2 == 1:
				bob.append(l[i])
	if sum(alice) > sum(bob):
		print('Alice')
	elif sum(bob) > sum(alice):
		print('Bob')
	else:
		print('Tie')
	t -= 1


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	A = list(sorted(map(int, input().split())))
	(turn, alice, bob) = (0, 0, 0)
	while A:
		cur = A.pop()
		if turn % 2 == 0:
			if cur % 2 == 0:
				alice += cur
		elif turn % 2 == 1:
			if cur % 2 == 1:
				bob += cur
		turn += 1
	if alice > bob:
		print('Alice')
	elif bob > alice:
		print('Bob')
	else:
		print('Tie')


cases = int(input())
for t in range(cases):
	n = int(input())
	arr = list(map(int, input().split(' ')))
	alice_turn = True
	alice_point = 0
	bob_point = 0
	arr.sort()
	while n > 0:
		selected = arr.pop()
		if alice_turn and selected % 2 == 0:
			alice_point += selected
		elif not alice_turn and selected % 2 == 1:
			bob_point += selected
		alice_turn = not alice_turn
		n -= 1
	if alice_point > bob_point:
		print('Alice')
	elif alice_point < bob_point:
		print('Bob')
	else:
		print('Tie')


def play_game(arr):
	res = 0
	arr.sort(reverse=True)
	for i in range(len(arr)):
		if i % 2 == 0:
			if arr[i] % 2 == 0:
				res += arr[i]
		elif arr[i] % 2 == 1:
			res -= arr[i]
	if res == 0:
		return 'Tie'
	elif res > 0:
		return 'Alice'
	else:
		return 'Bob'

def main():
	n = int(input())
	for i in range(n):
		t = int(input())
		arr = list(map(int, input().split(' ')))
		print(play_game(arr))
main()


def alice(l, m, i, j):
	if l[i] >= m[j]:
		return 1
	return 0

def bob(l, m, i, j):
	if m[j] >= l[i]:
		return 1
	return 0
t = int(input())
for i in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	a = list(filter(lambda x: x % 2 == 0, l))
	b = list(filter(lambda x: x % 2 != 0, l))
	a.sort(reverse=True)
	b.sort(reverse=True)
	c = len(a)
	d = len(b)
	p = 0
	q = 0
	sa = 0
	sb = 0
	x = 1
	y = 0
	while p <= c - 1 or q <= d - 1:
		if x == 1:
			if p <= c - 1 and q <= d - 1:
				if alice(a, b, p, q):
					sa += a[p]
					p += 1
				else:
					q += 1
			elif p > c - 1 and q <= d - 1:
				q += 1
			else:
				sa += a[p]
				p += 1
			x = 0
			y = 1
		if y == 1:
			if p <= c - 1 and q <= d - 1:
				if bob(a, b, p, q):
					sb += b[q]
					q += 1
				else:
					p += 1
			elif p > c - 1 and q <= d - 1:
				sb += b[q]
				q += 1
			else:
				p += 1
			x = 1
			y = 0
	if sa > sb:
		print('Alice')
	elif sa < sb:
		print('Bob')
	else:
		print('Tie')


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

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

def main():
	for _ in range(int(input())):
		n = int(input())
		ar = inpt()
		odd = []
		even = []
		for i in ar:
			if i & 1:
				odd.append(i)
			else:
				even.append(i)
		odd.sort(reverse=True)
		even.sort(reverse=True)
		turn = 1
		(alice, bob) = (0, 0)
		(i, j) = (0, 0)
		while i < len(odd) and j < len(even):
			if turn:
				if odd[i] > even[j]:
					i += 1
				else:
					alice += even[j]
					j += 1
			elif odd[i] < even[j]:
				j += 1
			else:
				bob += odd[i]
				i += 1
			turn ^= 1
		while i < len(odd):
			if not turn:
				bob += odd[i]
			i += 1
			turn ^= 1
		while j < len(even):
			if turn:
				alice += even[j]
			j += 1
			turn ^= 1
		if alice > bob:
			print('Alice')
		elif bob > alice:
			print('Bob')
		else:
			print('Tie')
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()


for _ in range(int(input())):
	input()
	n = [int(i) for i in input().split()]
	n.sort()
	(b, a) = (0, 0)
	hod = True
	while n:
		if hod and n[-1] % 2 == 0:
			a += n[-1]
		elif not hod and n[-1] % 2 == 1:
			b += n[-1]
		n.pop(-1)
		hod = not hod
	if a > b:
		print('Alice')
	elif a < b:
		print('Bob')
	elif a == b:
		print('Tie')


for i in range(int(input())):
	b = int(input())
	c1 = c2 = 0
	(*a,) = map(int, input().split())
	a.sort(reverse=True)
	for j in range(b):
		if j % 2 == 0:
			c1 = c1 + a[j] if a[j] % 2 == 0 else c1 + 0
		else:
			c2 = c2 + a[j] if a[j] % 2 != 0 else c2 + 0
	print('Alice' if c1 > c2 else 'Bob' if c1 < c2 else 'Tie')


def solution(n, l):
	l.sort(reverse=True)
	score_A = 0
	score_B = 0
	score_A = sum([elem for elem in l[0::2] if elem % 2 == 0])
	score_B = sum([elem for elem in l[1::2] if elem % 2 == 1])
	if score_A > score_B:
		print('Alice')
	elif score_B > score_A:
		print('Bob')
	else:
		print('Tie')
T = int(input())
for t in range(1, T + 1):
	n = int(input())
	l = list(map(int, input().split()))
	solution(n, l)


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	alice_score = 0
	bob_score = 0
	alice_arr = []
	bob_arr = []
	for i in l:
		if i % 2:
			bob_arr.append(i)
		else:
			alice_arr.append(i)
	bob_arr.sort(reverse=True)
	alice_arr.sort(reverse=True)
	i = 0
	j = 0
	turn = 0
	while i < len(alice_arr) or j < len(bob_arr):
		if not turn:
			if i < len(alice_arr) and (j >= len(bob_arr) or alice_arr[i] > bob_arr[j]):
				alice_score += alice_arr[i]
				i += 1
			else:
				j += 1
		elif j < len(bob_arr) and (i >= len(alice_arr) or alice_arr[i] < bob_arr[j]):
			bob_score += bob_arr[j]
			j += 1
		else:
			i += 1
		turn ^= 1
	if alice_score > bob_score:
		print('Alice')
	elif alice_score == bob_score:
		print('Tie')
	else:
		print('Bob')


t = int(input())
for i in range(t):
	n = int(input())
	a = [int(i) for i in input().split(' ')]
	alica = 0
	bob = 0
	a.sort()
	a.reverse()
	for i in range(n):
		if a[i] % 2 == 0 and i % 2 == 0:
			alica += a[i]
		if a[i] % 2 == 1 and i % 2 == 1:
			bob += a[i]
	if alica == bob:
		print('Tie')
	if alica < bob:
		print('Bob')
	if alica > bob:
		print('Alice')


import bisect
for t in range(int(input())):
	n = int(input())
	a = sorted(list(map(int, input().split())), reverse=True)
	ans = 0
	for i in range(n):
		if i % 2 == 0:
			if a[i] % 2 == 0:
				ans += a[i]
		elif a[i] % 2 == 1:
			ans -= a[i]
	if ans > 0:
		print('Alice')
	elif ans < 0:
		print('Bob')
	else:
		print('Tie')


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort(reverse=True)
	s = 0
	m = 0
	for i in range(n):
		if i % 2 == 0:
			if a[i] % 2 == 0:
				s = s + a[i]
		elif a[i] % 2 != 0:
			m = m + a[i]
	if s == m:
		print('Tie')
	elif s > m:
		print('Alice')
	else:
		print('Bob')


for i in range(int(input())):
	n = int(input())
	a = sorted(list(map(int, input().split())))[::-1]
	x = sum([i for i in a[::2] if not i % 2])
	y = sum([i for i in a[1::2] if i % 2])
	if x > y:
		print('Alice')
	elif x < y:
		print('Bob')
	else:
		print('Tie')


import math

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

def getstr():
	return [str(i) for i in input().split()]

def solve():
	n = int(input())
	a = getint()
	a.sort(reverse=True)
	Alice = 0
	Bob = 0
	for i in a[0::2]:
		if i % 2 == 0:
			Alice += i
	for i in a[1::2]:
		if i % 2 == 1:
			Bob += i
	if Alice == Bob:
		print('Tie')
	else:
		print('Alice' if Alice > Bob else 'Bob')
for _ in range(int(input())):
	solve()


import re
t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort(reverse=True)
	score = [0, 0]
	for i in range(n):
		if i % 2 == a[i] % 2:
			score[i % 2] += a[i]
	if score[0] > score[1]:
		print('Alice')
	elif score[0] < score[1]:
		print('Bob')
	else:
		print('Tie')


import sys

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

def map_string():
	return map(str, sys.stdin.readline().strip().split())

def get_string():
	return sys.stdin.readline().strip()
t = int(get_string())
for _ in range(t):
	n = int(get_string())
	arr = list(get_ints())
	arr = sorted(arr, reverse=True)
	(alice, bob) = (0, 0)
	for i in range(n):
		if i % 2 == 0:
			if arr[i] % 2 == 0:
				alice += arr[i]
		elif arr[i] % 2 != 0:
			bob += arr[i]
	if alice > bob:
		print('Alice')
	elif bob > alice:
		print('Bob')
	else:
		print('Tie')


import io, os
inp = io.BytesIO(os.read(0, os.fstat(0).st_size)).readlines()
for tc in range(1, int(inp[0]) + 1):
	a = [0, 0]
	for (i, x) in enumerate(sorted(map(int, inp[tc << 1].split()), reverse=True)):
		if i & 1 == x & 1:
			a[i & 1] += x
	if a[0] == a[1]:
		print('Tie')
	elif a[0] > a[1]:
		print('Alice')
	else:
		print('Bob')


for i in range(int(input())):
	k = int(input())
	tec = 0
	spic = sorted(list(map(int, input().split())), reverse=True)
	for j in range(k):
		if j % 2 == 0:
			if spic[j] % 2 == 0:
				tec += spic[j]
		elif spic[j] % 2 != 0:
			tec -= spic[j]
	if tec > 0:
		print('Alice')
	elif tec < 0:
		print('Bob')
	else:
		print('Tie')


class Solution:

	def solve(self, arr):
		alice = sorted([a for a in arr if a % 2 == 0], reverse=True)
		bob = sorted([a for a in arr if a % 2 != 0], reverse=True)
		alice_n = len(alice)
		bob_n = len(bob)
		alice_sum = 0
		bob_sum = 0
		turn = 0
		i = 0
		j = 0
		while True:
			if i == alice_n and j == bob_n:
				break
			if i == alice_n:
				num = bob[j]
				j += 1
			elif j == bob_n:
				num = alice[i]
				i += 1
			elif alice[i] > bob[j]:
				num = alice[i]
				i += 1
			elif bob[j] > alice[i]:
				num = bob[j]
				j += 1
			else:
				num = alice[i]
			if turn == 0:
				if num % 2 == 0:
					alice_sum += num
				turn = 1
			else:
				if num % 2 != 0:
					bob_sum += num
				turn = 0
		if alice_sum > bob_sum:
			return 'Alice'
		elif bob_sum > alice_sum:
			return 'Bob'
		else:
			return 'Tie'
sol = Solution()
tests = int(input())
for t in range(tests):
	n = int(input())
	arr = list(map(int, input().split()))
	result = sol.solve(arr)
	print(result)


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort(reverse=True)
	flag = True
	s = 0
	for i in arr:
		if flag and i % 2 == 0:
			s += i
		if not flag and i % 2 != 0:
			s -= i
		flag = not flag
	if s > 0:
		print('Alice')
	elif s == 0:
		print('Tie')
	else:
		print('Bob')


for _ in range(int(input())):
	n = int(input())
	lis = list(map(int, input().split()))
	lis.sort(reverse=True)
	g = 0
	for i in range(n):
		if i % 2 == 0:
			if lis[i] % 2 == 0:
				g += lis[i]
		elif lis[i] % 2 != 0:
			g -= lis[i]
	if g > 0:
		print('Alice')
	elif g < 0:
		print('Bob')
	else:
		print('Tie')


import sys, random, bisect
from collections import deque, defaultdict
from heapq import heapify, heappop, heappush
from math import gcd
mod = int(1000000000.0 + 7)
inf = int(1e+20)
input = lambda : sys.stdin.readline().rstrip()
mi = lambda : map(int, input().split())
li = lambda : list(mi())
ii = lambda : int(input())
py = lambda : print('YES')
pn = lambda : print('NO')
t = ii()
for _ in range(t):
	n = ii()
	arr = li()
	a = b = 0
	for (i, num) in enumerate(sorted(arr, reverse=True)):
		if i % 2 == 0:
			if num % 2 == 0:
				a += num
		elif num % 2 == 1:
			b += num
	if a > b:
		print('Alice')
	elif a < b:
		print('Bob')
	else:
		print('Tie')


from sys import stdin, stdout
import math, bisect
from collections import Counter, deque, defaultdict
L = lambda : list(map(int, stdin.readline().strip().split()))
I = lambda : int(stdin.readline().strip())
S = lambda : stdin.readline().strip()
C = lambda : stdin.readline().strip().split()

def pr(a):
	print(' '.join(list(map(str, a))))

def solve():
	n = I()
	a = L()
	e = []
	o = []
	for i in a:
		if i % 2:
			o += [i]
		else:
			e += [i]
	e.sort()
	o.sort()
	(x, y) = (0, 0)
	for i in range(n):
		if i % 2 == 0:
			if o and e:
				if o[-1] > e[-1]:
					o.pop()
				else:
					x += e[-1]
					e.pop()
			elif e:
				x += e[-1]
				e.pop()
			else:
				o.pop()
		elif e and o:
			if e[-1] > o[-1]:
				e.pop()
			else:
				y += o[-1]
				o.pop()
		elif o:
			y += o[-1]
			o.pop()
		else:
			e.pop()
	if x > y:
		print('Alice')
	elif x == y:
		print('Tie')
	else:
		print('Bob')
for _ in range(I()):
	solve()


import sys
from collections import Counter

def get_ints():
	return list(map(int, sys.stdin.readline().strip().split()))
sys.setrecursionlimit(20000)
T = int(input())
for _ in range(T):
	n = int(input())
	A = get_ints()
	A.sort(reverse=True)
	score = [0, 0]
	for i in range(len(A)):
		if i % 2 == 0 and A[i] % 2 == 0:
			score[0] += A[i]
		if i % 2 == 1 and A[i] % 2 == 1:
			score[1] += A[i]
	if score[0] > score[1]:
		print('Alice')
	elif score[0] < score[1]:
		print('Bob')
	else:
		print('Tie')


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):
	n = inputnum()
	a = inputlist()
	a.sort(reverse=True)
	bob = 0
	alice = 0
	for i in range(n):
		if i % 2 == 0 and a[i] % 2 == 0:
			alice += a[i]
		if i % 2 == 1 and a[i] % 2 == 1:
			bob += a[i]
	if bob == alice:
		print('Tie')
	elif bob > alice:
		print('Bob')
	else:
		print('Alice')


import sys
n_games = int(sys.stdin.readline())
for _ in range(n_games):
	num_of_nums = int(sys.stdin.readline())
	nums = [int(s) for s in sys.stdin.readline().split()]
	assert num_of_nums == len(nums)
	nums.sort()
	nums.reverse()
	s = 0
	turn = True
	for play in nums:
		if turn:
			if play % 2 == 0:
				s += play
		elif play % 2 != 0:
			s -= play
		turn = not turn
	if s == 0:
		print('Tie')
	elif s > 0:
		print('Alice')
	else:
		print('Bob')


from sys import stdin, stdout
from collections import *
from math import gcd, floor, ceil

def st():
	return list(stdin.readline().strip())

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

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

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

def pr(n):
	return stdout.write(str(n) + '\n')
mod = 1000000007
INF = float('inf')

def solve():
	n = inp()
	l = li()
	l.sort(reverse=True)
	a = l[::2]
	b = l[1::2]
	(x, y) = (0, 0)
	for i in a:
		if i % 2 == 0:
			x += i
	for i in b:
		if i & 1:
			y += i
	if x < y:
		pr('Bob')
		return
	if x > y:
		pr('Alice')
		return
	pr('Tie')
for _ in range(inp()):
	solve()


def find_winner(a):
	a = sorted(a, reverse=True)
	alice_score = sum([v if v % 2 == 0 else 0 for (i, v) in enumerate(a) if i % 2 == 0])
	bob_score = sum([v if v % 2 == 1 else 0 for (i, v) in enumerate(a) if i % 2 == 1])
	if alice_score > bob_score:
		return 'Alice'
	elif alice_score < bob_score:
		return 'Bob'
	else:
		return 'Tie'
n_samples = int(input())
for t in range(n_samples):
	n = int(input())
	a = list(map(int, input().split(' ')))
	assert len(a) == n
	print(find_winner(a))


t = int(input())
for _ in range(0, t):
	n = int(input())
	list1 = [int(num) for num in input().split()]
	list1.sort()
	c1 = 0
	c2 = 0
	k = 1
	for i in range(len(list1) - 1, -1, -1):
		num = list1[i]
		if k == 1:
			if num % 2 == 0:
				c1 += num
			k = -1
		else:
			if num % 2 == 1:
				c2 += num
			k = 1
	if c1 > c2:
		print('Alice')
	elif c2 > c1:
		print('Bob')
	else:
		print('Tie')


import sys
n_tests = int(sys.stdin.readline().strip())
for _ in range(n_tests):
	alice = 0
	bob = 0
	max_index = int(sys.stdin.readline().strip())
	l1 = [int(v) for v in sys.stdin.readline().strip().split(' ')]
	l1.sort()
	i = 1
	while l1:
		v = l1.pop()
		if i % 2 == 0:
			if v % 2 != 0:
				bob += v
		elif v % 2 == 0:
			alice += v
		i += 1
	if alice > bob:
		print('Alice')
	elif bob > alice:
		print('Bob')
	else:
		print('Tie')


import sys
lines = [list(map(int, line.split())) for line in sys.stdin.readlines()]
lines.pop(0)
while lines:
	alice = 0
	bob = 0
	arr = lines[1]
	arr.sort(reverse=True)
	i = 0
	for x in arr:
		if not (i & 1 or x & 1):
			alice += x
		elif i & 1 and x & 1:
			bob += x
		i += 1
	if bob > alice:
		print('Bob ')
	elif alice > bob:
		print('Alice ')
	else:
		print('Tie')
	lines = lines[2:]


n = int(input())
while n != 0:
	a = input()
	b = list(map(int, input().split()))
	b = sorted(b)
	b = b[::-1]
	w = b[::2]
	x = b[1::2]
	alice = []
	bob = []
	for i in w:
		if i % 2 == 0:
			alice.append(i)
	for i in x:
		if i % 2 != 0:
			bob.append(i)
	alice = sum(alice)
	bob = sum(bob)
	if alice > bob:
		print('Alice')
	elif alice == bob:
		print('Tie')
	else:
		print('Bob')
	n -= 1


for t in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort(reverse=True)
	(a, b) = (0, 0)
	for i in range(len(l)):
		if i % 2 == 0:
			if l[i] % 2 == 0:
				a += l[i]
		elif l[i] % 2 != 0:
			b += l[i]
	if a != b:
		print('Alice' if a > b else 'Bob')
	else:
		print('Tie')


import sys
input = sys.stdin.readline
t = int(input())
for k in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	(p, q) = ([], [])
	(x, y) = (0, 0)
	for i in range(n):
		if a[i] % 2 == 0:
			p.append(a[i])
			x += 1
		else:
			q.append(a[i])
			y += 1
	p = sorted(p, reverse=True)
	q = sorted(q, reverse=True)
	(i, j) = (0, 0)
	(r, s) = (0, 0)
	c = 0
	while i < x or j < y:
		if i < x and j < y:
			z = max(p[i], q[j])
		elif i < x:
			z = p[i]
		elif j < y:
			z = q[j]
		if c % 2 == 1:
			if z % 2 == 1:
				s += z
				j += 1
			else:
				i += 1
		elif c % 2 == 0:
			if z % 2 == 0:
				r += z
				i += 1
			else:
				j += 1
		c += 1
	if s > r:
		print('Bob')
	elif r == s:
		print('Tie')
	else:
		print('Alice')


t = int(input())
for _ in range(t):
	n = int(input())
	a = sorted(list(map(int, input().split())), reverse=True)
	cnt = 0
	alice = 0
	bob = 0
	for i in a:
		if cnt % 2:
			if i % 2:
				bob += i
		elif i % 2 == 0:
			alice += i
		cnt += 1
	print('Alice') if alice > bob else print('Bob') if alice < bob else print('Tie')


for _ in range(int(input())):
	n = int(input())
	an = list(map(int, input().split()))
	an.sort()
	alice = 0
	bob = 0
	for i in range(n):
		if i % 2 == 0:
			if an[-1] % 2 == 0:
				alice += an[-1]
			an.pop(-1)
		else:
			if an[-1] % 2 == 1:
				bob += an[-1]
			an.pop(-1)
	if alice > bob:
		print('Alice')
	elif alice < bob:
		print('Bob')
	else:
		print('Tie')


def EvenOddGame(n, arr):
	arr.sort(reverse=True)
	ans = 0
	for i in range(0, n):
		if i % 2 == 0:
			if arr[i] % 2 == 0:
				ans += arr[i]
		elif arr[i] % 2 == 1:
			ans -= arr[i]
	if ans == 0:
		return 'Tie'
	elif ans > 0:
		return 'Alice'
	else:
		return 'Bob'
tc = int(input())
for _ in range(0, tc):
	n = int(input())
	arr = [int(i) for i in input().split()][:n]
	print(EvenOddGame(n, arr))


t = int(input())
for case in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	(alice, bob, flag) = (0, 0, 1)
	for i in sorted(a, reverse=True):
		if flag:
			if not i & 1:
				alice += i
			flag = 0
		else:
			if i & 1:
				bob += i
			flag = 1
	if alice > bob:
		print('Alice')
	elif bob > alice:
		print('Bob')
	else:
		print('Tie')


t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	a.sort(reverse=True)
	reza = 0
	rezb = 0
	for i in a:
		if i % 2 == 0:
			reza += i
		else:
			rezb += i
	for i in range(n):
		if i % 2 == 0:
			if a[i] % 2 != 0:
				rezb -= a[i]
		elif a[i] % 2 == 0:
			reza -= a[i]
	if reza > rezb:
		print('Alice')
	elif rezb > reza:
		print('Bob')
	else:
		print('Tie')


t = int(input())
for i in range(t):
	ans = 0
	n = int(input())
	nums = list(map(int, input().split()))
	nums.sort(reverse=True)
	for j in range(0, n, 2):
		if nums[j] % 2 == 0:
			ans += nums[j]
	for j in range(1, n, 2):
		if nums[j] % 2 == 1:
			ans -= nums[j]
	if ans == 0:
		print('Tie')
	elif ans > 0:
		print('Alice')
	else:
		print('Bob')


t = int(input())
for z in range(t):
	n = int(input())
	e = sorted([int(q) for q in input().split()], reverse=True)
	w = 0
	for i in range(n):
		if i % 2 == 0 and e[i] % 2 == 0:
			w += e[i]
		if i % 2 == 1 and e[i] % 2 == 1:
			w -= e[i]
	if w > 0:
		print('Alice')
	elif w < 0:
		print('Bob')
	else:
		print('Tie')


import sys, heapq

def evenOddGame(n, a):
	(even, odd, bob, alice, turn) = ([], [], 0, 0, 1)
	for i in a:
		if i & 1:
			heapq.heappush(odd, -i)
		else:
			heapq.heappush(even, -i)
	for i in range(n):
		if turn:
			if not odd or (even and even[0] <= odd[0]):
				alice -= heapq.heappop(even)
			else:
				heapq.heappop(odd)
		elif not even or (odd and odd[0] <= even[0]):
			bob -= heapq.heappop(odd)
		else:
			heapq.heappop(even)
		turn ^= 1
	if alice > bob:
		return 'Alice'
	elif bob > alice:
		return 'Bob'
	else:
		return 'Tie'

def main():
	for _ in range(int(input())):
		(n, a) = (int(input()), [int(i) for i in input().split()])
		print(evenOddGame(n, a))
main()


t = int(input())
while t != 0:
	n = int(input())
	list1 = list(map(int, input().split()))
	even = []
	odd = []
	for i in range(n):
		if list1[i] % 2 == 0:
			even.append(list1[i])
		else:
			odd.append(list1[i])
	even.sort()
	odd.sort()
	(a, b) = (0, 0)
	while 1:
		if len(even) == len(odd) == 0:
			break
		if len(even) == 0 or len(odd) == 0:
			if len(odd) == 0:
				a += even[-1]
				even.pop()
			elif len(even) == 0:
				odd.pop()
		elif even[-1] >= odd[-1]:
			a += even[-1]
			even.pop()
		else:
			odd.pop()
		if len(even) == len(odd) == 0:
			break
		if len(even) == 0 or len(odd) == 0:
			if len(even) == 0:
				b += odd[-1]
				odd.pop()
			elif len(odd) == 0:
				even.pop()
		elif even[-1] <= odd[-1]:
			b += odd[-1]
			odd.pop()
		else:
			even.pop()
	if a > b:
		print('Alice')
	elif a == b:
		print('Tie')
	else:
		print('Bob')
	t -= 1


for _ in range(int(input())):
	n = int(input())
	a = [*map(int, input().split())]
	al = 0
	b = 0
	a.sort(reverse=True)
	t = 0
	for i in range(n):
		if t == 0:
			if a[i] % 2 == 0:
				al += a[i]
			t ^= 1
		else:
			if a[i] % 2:
				b += a[i]
			t ^= 1
	if al == b:
		print('Tie')
	else:
		print('Alice' if al > b else 'Bob')


t = int(input())
for tt in range(t):
	n = int(input())
	f = list(map(int, input().split()))
	f.sort()
	a = 0
	b = 0
	for i in range(n):
		if f[-1] % 2 == 0:
			if i % 2 == 0:
				a += f[-1]
		elif i % 2 != 0:
			b += f[-1]
		f.pop()
	if a > b:
		print('Alice')
	elif b > a:
		print('Bob')
	else:
		print('Tie')


import heapq

def change(intstr=''):
	return -int(intstr)
t = int(input())
for tc in range(t):
	n = int(input())
	board = list(map(change, input().split()))
	a = 0
	b = 0
	heapq.heapify(board)
	is_a_turn = True
	while len(board) > 0:
		tmp = heapq.heappop(board)
		if is_a_turn:
			if tmp % 2 == 0:
				a += tmp
		elif tmp % 2 == 1:
			b += tmp
		is_a_turn = not is_a_turn
	if a < b:
		print('Alice')
	elif b < a:
		print('Bob')
	else:
		print('Tie')


t = int(input())
for _ in range(t):
	n = int(input())
	(*a,) = map(int, input().split())
	a.sort(reverse=1)
	r = 0
	for i in range(n):
		if i % 2 == 0 and a[i] % 2 == 0:
			r += a[i]
		elif i % 2 == 1 and a[i] % 2 == 1:
			r -= a[i]
	if r == 0:
		print('Tie')
	elif r > 0:
		print('Alice')
	elif r < 0:
		print('Bob')


def even_odd_game():
	prob = int(input())
	for _ in range(prob):
		l = int(input())
		ls = list(map(int, input().split()))
		ls = sorted(ls, reverse=True)
		(alice, bob) = (0, 0)
		for (ind, v) in enumerate(ls):
			if v % 2 == 0:
				if ind % 2 == 0:
					alice += v
			elif ind % 2 != 0:
				bob += v
		if alice > bob:
			print('Alice')
		elif alice == bob:
			print('Tie')
		else:
			print('Bob')
even_odd_game()


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
alice = 'Alice'
bob = 'Bob'
tie = 'Tie'
for ii in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort(reverse=True)
	a = 0
	b = 0
	turn = 1
	for i in range(n):
		if arr[i] % 2:
			if not turn:
				b += arr[i]
		elif turn:
			a += arr[i]
		turn = not turn
	if a > b:
		print(alice)
	if a < b:
		print(bob)
	if a == b:
		print(tie)


t = int(input())
rlist = []
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split(' ')))
	aliceTurn = True
	alice = 0
	bob = 0
	a = sorted(a, reverse=True)
	for i in a:
		if aliceTurn and i % 2 == 0:
			alice += i
		elif not aliceTurn and i % 2 != 0:
			bob += i
		aliceTurn = not aliceTurn
	if bob == alice:
		rlist.append('Tie')
	elif bob > alice:
		rlist.append('Bob')
	else:
		rlist.append('Alice')
for i in rlist:
	print(i)


from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	l = list(map(int, stdin.readline().split()))
	l = sorted(l, reverse=True)
	shan = 0
	i = 0
	for a in l:
		if i & 1:
			if a & 1:
				shan -= a
		elif a % 2 == 0:
			shan += a
		i += 1
	if shan == 0:
		print('Tie')
	elif shan > 0:
		print('Alice')
	else:
		print('Bob')


for _ in range(int(input())):
	n = int(input())
	values = [int(i) for i in input().split()]
	(odd, even) = ([], [])
	for v in values:
		if v % 2 == 0:
			even.append(v)
		else:
			odd.append(v)
	even.sort()
	odd.sort()
	alice = 0
	bob = 0
	turn = 0
	while even or odd:
		if not turn:
			if even and odd and (even[-1] > odd[-1]):
				alice += even.pop()
			elif odd:
				odd.pop()
			elif even:
				alice += even.pop()
			turn = 1
		else:
			if even and odd and (odd[-1] > even[-1]):
				bob += odd.pop()
			elif even:
				even.pop()
			elif odd:
				bob += odd.pop()
			turn = 0
	if alice > bob:
		print('Alice')
	elif bob > alice:
		print('Bob')
	else:
		print('Tie')


import math
import bisect
from collections import defaultdict
from collections import OrderedDict
from itertools import combinations
for _ in range(int(input())):
	n = int(input())
	ar = list(map(int, input().split()))
	ans = 0
	odd = []
	even = []
	(alice, bob) = (0, 0)
	for i in ar:
		if i % 2 == 0:
			even.append(i)
		else:
			odd.append(i)
	odd.sort(reverse=True)
	even.sort(reverse=True)
	(lo, le) = (len(odd), len(even))
	(l1, l2) = (0, 0)
	i = 0
	while l1 < lo or l2 < le:
		if i % 2 == 0:
			if l1 < lo and l2 < le and (odd[l1] > even[l2]):
				l1 += 1
			elif l1 < lo and l2 < le and (odd[l1] < even[l2]):
				alice += even[l2]
				l2 += 1
			elif l1 >= lo and l2 < le:
				alice += even[l2]
				l2 += 1
			elif l2 >= le and l1 < lo:
				l1 += 1
		elif l1 < lo and l2 < le and (odd[l1] < even[l2]):
			l2 += 1
		elif l1 < lo and l2 < le and (odd[l1] > even[l2]):
			bob += odd[l1]
			l1 += 1
		elif l2 >= le and l1 < lo:
			bob += odd[l1]
			l1 += 1
		elif l1 >= lo and l2 < le:
			l2 += 1
		i += 1
	if alice > bob:
		print('Alice')
	elif bob > alice:
		print('Bob')
	else:
		print('Tie')


def sol():
	n = int(input())
	a = list(map(int, input().split()))
	a.sort(reverse=True)
	ans = 0
	for i in range(n):
		if i % 2 == 0:
			if a[i] % 2 == 0:
				ans += a[i]
		elif a[i] % 2 != 0:
			ans -= a[i]
	if ans > 0:
		print('Alice')
	elif ans == 0:
		print('Tie')
	elif ans < 0:
		print('Bob')
try:
	for _ in range(int(input())):
		sol()
except:
	pass


def solve():
	N = int(input())
	nums = [int(x) for x in input().split()]
	nums.sort(reverse=True)
	alice = 0
	bob = 0
	for i in range(N):
		if i % 2 == 0:
			if nums[i] % 2 == 0:
				alice += nums[i]
		elif nums[i] % 2 == 1:
			bob += nums[i]
	print('Alice' if alice > bob else 'Bob' if bob > alice else 'Tie')
T = int(input())
for _ in range(T):
	solve()


import math
import sys

def get_ints():
	return map(int, sys.stdin.readline().strip().split())
T = int(input())
for t in range(T):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort(reverse=True)
	ans = 0
	for i in range(n):
		if a[i] % 2 == i % 2:
			if i % 2 == 1:
				ans -= a[i]
			else:
				ans += a[i]
	if ans > 0:
		print('Alice')
	elif ans == 0:
		print('Tie')
	else:
		print('Bob')


t = int(input())
for tt in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort(reverse=True)
	ass = 0
	bs = 0
	turn = 1
	for i in a:
		if turn == 1:
			turn = 2
			if i % 2 == 0:
				ass += i
		else:
			turn = 1
			if i % 2 != 0:
				bs += i
	if ass > bs:
		print('Alice')
	elif ass < bs:
		print('Bob')
	else:
		print('Tie')


t = int(input())
for j in range(t):
	n = int(input())
	lst = [int(i) for i in input().split()]
	lst.sort(reverse=True)
	alice = 0
	bob = 0
	for i in range(n):
		if i % 2 == 0 and lst[i] % 2 == 0:
			alice = alice + lst[i]
		elif i % 2 == 1 and lst[i] % 2 == 1:
			bob = bob + lst[i]
	if alice == bob:
		print('Tie')
	elif alice > bob:
		print('Alice')
	else:
		print('Bob')


t = int(input())
while t:
	n = int(input())
	l = list(map(int, input().split()))
	l.sort(reverse=True)
	asc = 0
	bsc = 0
	for i in range(n):
		if i % 2 == 0 and l[i] % 2 == 0:
			asc += l[i]
		elif i % 2 != 0 and l[i] % 2 != 0:
			bsc += l[i]
		else:
			pass
	if asc > bsc:
		print('Alice')
	elif asc == bsc:
		print('Tie')
	else:
		print('Bob')
	t = t - 1


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	dif = 0
	(l1, l2) = ([i for i in l if i % 2 != 0], [i for i in l if i % 2 == 0])
	(alev, bood, c) = (0, 0, 0)
	while len(l1) > 0 or len(l2) > 0:
		if c % 2 == 0:
			if (len(l1) > 0 and len(l2) > 0) and l1[-1] > l2[-1]:
				l1.pop()
			elif len(l2) == 0:
				l1.pop()
			else:
				alev += l2.pop()
		elif (len(l1) > 0 and len(l2) > 0) and l1[-1] < l2[-1]:
			l2.pop()
		elif len(l1) == 0:
			l2.pop()
		else:
			bood += l1.pop()
		c += 1
	if alev > bood:
		print('Alice')
	elif alev < bood:
		print('Bob')
	else:
		print('Tie')


def nr():
	return nrs()[0]

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

def sign(a):
	return 0 if a == 0 else int(a / abs(a))
for _ in range(nr()):
	n = nr()
	arr = list(reversed(sorted(nrs())))
	a = sum([i for i in arr[::2] if i % 2 == 0])
	b = sum([i for i in arr[1::2] if i % 2])
	print(['Bob', 'Tie', 'Alice'][1 + sign(a - b)])


def scores(arr):
	arr = sorted(arr)[::-1]
	alice = 0
	bob = 0
	for (idx, val) in enumerate(arr):
		if idx % 2 == 0:
			if val % 2 == 0:
				alice += val
		elif val % 2 != 0:
			bob += val
	return (alice, bob)

def main():
	t = int(input())
	for x in range(0, t):
		n = int(input())
		arr = list(map(int, input().split()))
		result = scores(arr)
		if result[0] == result[1]:
			print('Tie')
		elif result[0] > result[1]:
			print('Alice')
		else:
			print('Bob')
main()


from sys import stdin as sin

def aint():
	return int(sin.readline())

def amap():
	return map(int, sin.readline().split())

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

def astr():
	return str(sin.readline().split())
for _ in range(int(input())):
	n = int(input())
	l = alist()
	l.sort(reverse=True)
	gl = 0
	for i in range(n):
		if i % 2 == 0:
			if l[i] % 2 == 0:
				gl += l[i]
		elif l[i] % 2 != 0:
			gl -= l[i]
	if gl > 0:
		print('Alice')
	elif gl < 0:
		print('Bob')
	else:
		print('Tie')


for _ in range(int(input())):
	a = int(input())
	b = list(sorted(map(int, input().split())))
	b = b[::-1]
	maxi = 0
	w = 0
	m = 0
	n = 0
	for i in range(a):
		if b[i] % 2 == 0 and i % 2 == 0:
			w += b[i]
		elif i % 2 != 0 and b[i] % 2 != 0:
			m += b[i]
	if w > m:
		print('Alice')
	elif m > w:
		print('Bob')
	else:
		print('Tie')


import os
import sys
from io import BytesIO, IOBase
import heapq as h
import bisect
from types import GeneratorType
BUFSIZE = 8192

class SortedList:

	def __init__(self, iterable=[], _load=200):
		values = sorted(iterable)
		self._len = _len = len(values)
		self._load = _load
		self._lists = _lists = [values[i:i + _load] for i in range(0, _len, _load)]
		self._list_lens = [len(_list) for _list in _lists]
		self._mins = [_list[0] for _list in _lists]
		self._fen_tree = []
		self._rebuild = True

	def _fen_build(self):
		self._fen_tree[:] = self._list_lens
		_fen_tree = self._fen_tree
		for i in range(len(_fen_tree)):
			if i | i + 1 < len(_fen_tree):
				_fen_tree[i | i + 1] += _fen_tree[i]
		self._rebuild = False

	def _fen_update(self, index, value):
		if not self._rebuild:
			_fen_tree = self._fen_tree
			while index < len(_fen_tree):
				_fen_tree[index] += value
				index |= index + 1

	def _fen_query(self, end):
		if self._rebuild:
			self._fen_build()
		_fen_tree = self._fen_tree
		x = 0
		while end:
			x += _fen_tree[end - 1]
			end &= end - 1
		return x

	def _fen_findkth(self, k):
		_list_lens = self._list_lens
		if k < _list_lens[0]:
			return (0, k)
		if k >= self._len - _list_lens[-1]:
			return (len(_list_lens) - 1, k + _list_lens[-1] - self._len)
		if self._rebuild:
			self._fen_build()
		_fen_tree = self._fen_tree
		idx = -1
		for d in reversed(range(len(_fen_tree).bit_length())):
			right_idx = idx + (1 << d)
			if right_idx < len(_fen_tree) and k >= _fen_tree[right_idx]:
				idx = right_idx
				k -= _fen_tree[idx]
		return (idx + 1, k)

	def _delete(self, pos, idx):
		_lists = self._lists
		_mins = self._mins
		_list_lens = self._list_lens
		self._len -= 1
		self._fen_update(pos, -1)
		del _lists[pos][idx]
		_list_lens[pos] -= 1
		if _list_lens[pos]:
			_mins[pos] = _lists[pos][0]
		else:
			del _lists[pos]
			del _list_lens[pos]
			del _mins[pos]
			self._rebuild = True

	def _loc_left(self, value):
		if not self._len:
			return (0, 0)
		_lists = self._lists
		_mins = self._mins
		(lo, pos) = (-1, len(_lists) - 1)
		while lo + 1 < pos:
			mi = lo + pos >> 1
			if value <= _mins[mi]:
				pos = mi
			else:
				lo = mi
		if pos and value <= _lists[pos - 1][-1]:
			pos -= 1
		_list = _lists[pos]
		(lo, idx) = (-1, len(_list))
		while lo + 1 < idx:
			mi = lo + idx >> 1
			if value <= _list[mi]:
				idx = mi
			else:
				lo = mi
		return (pos, idx)

	def _loc_right(self, value):
		if not self._len:
			return (0, 0)
		_lists = self._lists
		_mins = self._mins
		(pos, hi) = (0, len(_lists))
		while pos + 1 < hi:
			mi = pos + hi >> 1
			if value < _mins[mi]:
				hi = mi
			else:
				pos = mi
		_list = _lists[pos]
		(lo, idx) = (-1, len(_list))
		while lo + 1 < idx:
			mi = lo + idx >> 1
			if value < _list[mi]:
				idx = mi
			else:
				lo = mi
		return (pos, idx)

	def add(self, value):
		_load = self._load
		_lists = self._lists
		_mins = self._mins
		_list_lens = self._list_lens
		self._len += 1
		if _lists:
			(pos, idx) = self._loc_right(value)
			self._fen_update(pos, 1)
			_list = _lists[pos]
			_list.insert(idx, value)
			_list_lens[pos] += 1
			_mins[pos] = _list[0]
			if _load + _load < len(_list):
				_lists.insert(pos + 1, _list[_load:])
				_list_lens.insert(pos + 1, len(_list) - _load)
				_mins.insert(pos + 1, _list[_load])
				_list_lens[pos] = _load
				del _list[_load:]
				self._rebuild = True
		else:
			_lists.append([value])
			_mins.append(value)
			_list_lens.append(1)
			self._rebuild = True

	def discard(self, value):
		_lists = self._lists
		if _lists:
			(pos, idx) = self._loc_right(value)
			if idx and _lists[pos][idx - 1] == value:
				self._delete(pos, idx - 1)

	def remove(self, value):
		_len = self._len
		self.discard(value)
		if _len == self._len:
			raise ValueError('{0!r} not in list'.format(value))

	def pop(self, index=-1):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		value = self._lists[pos][idx]
		self._delete(pos, idx)
		return value

	def bisect_left(self, value):
		(pos, idx) = self._loc_left(value)
		return self._fen_query(pos) + idx

	def bisect_right(self, value):
		(pos, idx) = self._loc_right(value)
		return self._fen_query(pos) + idx

	def count(self, value):
		return self.bisect_right(value) - self.bisect_left(value)

	def __len__(self):
		return self._len

	def __getitem__(self, index):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		return self._lists[pos][idx]

	def __delitem__(self, index):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		self._delete(pos, idx)

	def __contains__(self, value):
		_lists = self._lists
		if _lists:
			(pos, idx) = self._loc_left(value)
			return idx < len(_lists[pos]) and _lists[pos][idx] == value
		return False

	def __iter__(self):
		return (value for _list in self._lists for value in _list)

	def __reversed__(self):
		return (value for _list in reversed(self._lists) for value in reversed(_list))

	def __repr__(self):
		return 'SortedList({0})'.format(list(self))

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		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 = self.os.read(self._fd, max(self.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 = self.os.read(self._fd, max(self.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:
			self.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')
import sys
from math import ceil, log2
INT_MAX = sys.maxsize
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import collections as col
import math, string

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()

def listStr():
	return list(input())

def minVal(x, y):
	return x if x < y else y

def getMid(s, e):
	return s + (e - s) // 2

def RMQUtil(st, ss, se, qs, qe, index):
	if qs <= ss and qe >= se:
		return st[index]
	if se < qs or ss > qe:
		return INT_MAX
	mid = getMid(ss, se)
	return minVal(RMQUtil(st, ss, mid, qs, qe, 2 * index + 1), RMQUtil(st, mid + 1, se, qs, qe, 2 * index + 2))

def RMQ(st, n, qs, qe):
	if qs < 0 or qe > n - 1 or qs > qe:
		print('Invalid Input')
		return -1
	return RMQUtil(st, 0, n - 1, qs, qe, 0)

def constructSTUtil(arr, ss, se, st, si):
	if ss == se:
		st[si] = arr[ss]
		return arr[ss]
	mid = getMid(ss, se)
	st[si] = minVal(constructSTUtil(arr, ss, mid, st, si * 2 + 1), constructSTUtil(arr, mid + 1, se, st, si * 2 + 2))
	return st[si]

def constructST(arr, n):
	x = int(ceil(log2(n)))
	max_size = 2 * int(2 ** x) - 1
	st = [0] * max_size
	constructSTUtil(arr, 0, n - 1, st, 0)
	return st
MOD = 10 ** 9 + 7
mod = 10 ** 9 + 7
p = 10 ** 9 + 7

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 z_array(s1):
	n = len(s1)
	z = [0] * n
	(l, r, k) = (0, 0, 0)
	for i in range(1, n):
		if i > r:
			(l, r) = (i, i)
			while r < n and s1[r - l] == s1[r]:
				r += 1
			z[i] = r - l
			r -= 1
		else:
			k = i - l
			if z[k] < r - i + 1:
				z[i] = z[k]
			else:
				l = i
				while r < n and s1[r - l] == s1[r]:
					r += 1
				z[i] = r - l
				r -= 1
	return z

def primeFactors(n):
	d1 = {}
	while n % 2 == 0:
		d1[2] = d1.get(2, 0) + 1
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			d1[i] = d1.get(i, 0) + 1
			n = n // i
	if n > 2:
		d1[n] = d1.get(n, 0) + 1
	return d1

def fs(x):
	if x < 2:
		return 0
	return x * (x - 1) // 2
t = int(input())

def solve():
	le = []
	lo = []
	for i in l:
		if i % 2 == 0:
			le.append(i)
		else:
			lo.append(i)
	le.sort()
	lo.sort()
	(a, b) = (0, 0)
	turn = 0
	for i in range(n):
		if turn % 2 == 0:
			if len(lo) == 0:
				a += le[-1]
				le.pop()
			elif len(le) == 0:
				lo.pop()
			elif lo[-1] > le[-1]:
				lo.pop()
			else:
				a += le[-1]
				le.pop()
		elif len(le) == 0:
			b += lo[-1]
			lo.pop()
		elif len(lo) == 0:
			le.pop()
		elif le[-1] > lo[-1]:
			le.pop()
		else:
			b += lo[-1]
			lo.pop()
		turn += 1
	if a == b:
		return 'Tie'
	elif a > b:
		return 'Alice'
	else:
		return 'Bob'
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	print(solve())


from sys import stdin
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	arr = list(map(int, stdin.readline().split()))
	arr.sort(reverse=True)
	a = 0
	b = 0
	for i in range(n):
		if i % 2 == 0:
			if arr[i] % 2 == 0:
				a += arr[i]
		elif arr[i] % 2 != 0:
			b += arr[i]
	if a > b:
		print('Alice')
	elif a == b:
		print('Tie')
	else:
		print('Bob')


import sys

def answer(n, a):
	a.sort(reverse=True)
	suma = 0
	sumb = 0
	for i in range(0, n, 2):
		if a[i] % 2 == 0:
			suma += a[i]
	for i in range(1, n, 2):
		if a[i] % 2 == 1:
			sumb += a[i]
	if suma > sumb:
		return 'Alice'
	elif suma == sumb:
		return 'Tie'
	else:
		return 'Bob'
	return

def main():
	t = int(input())
	while t:
		n = int(sys.stdin.readline().rstrip())
		a = [int(i) for i in sys.stdin.readline().split()]
		print(answer(n, a))
		t -= 1
	return
main()


import math
import sys
input = sys.stdin.readline

def solve():
	n = int(input())
	arr = [int(_) for _ in input().split()]
	s = 0
	i = 1
	for el in sorted(arr, reverse=True):
		s += (el if el % 2 == 0 else 0) if i else -el if el % 2 == 1 else 0
		i = 1 - i
	print('Alice' if s > 0 else 'Bob' if s < 0 else 'Tie')
tt = int(input())
for test in range(tt):
	solve()


t = int(input())
a = []
b = []
for i in range(t):
	n = int(input())
	c = input().split()
	for j in range(len(c)):
		c[j] = int(c[j])
	a.append(c)
	b.append(n)
for i in range(t):
	d = []
	e = []
	for j in range(len(a[i])):
		if a[i][j] % 2 == 0:
			d.append(a[i][j])
		else:
			e.append(a[i][j])
	s = t = 0
	d.sort()
	e.sort()
	while len(d) > 0 or len(e) > 0:
		if len(d) > 0:
			if len(e) > 0:
				if d[-1] > e[-1]:
					s += d[-1]
					d.pop()
				else:
					e.pop()
			else:
				s += d[-1]
				d.pop()
		else:
			e.pop()
		if len(e) > 0:
			if len(d) > 0:
				if d[-1] < e[-1]:
					t += e[-1]
					e.pop()
				else:
					d.pop()
			else:
				t += e[-1]
				e.pop()
		elif len(d) > 0:
			d.pop()
	if s > t:
		print('Alice')
	elif s < t:
		print('Bob')
	else:
		print('Tie')


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
from copy import deepcopy
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())):
	n = int(data())
	arr = l()
	(even, odd) = ([], [])
	for i in arr:
		if i & 1:
			odd.append(i)
		else:
			even.append(i)
	odd.sort()
	even.sort()
	turn = True
	(alice, bob) = (0, 0)
	while even or odd:
		if turn:
			if even and odd:
				if odd[-1] > even[-1]:
					odd.pop()
				else:
					alice += even.pop()
			elif even:
				alice += even.pop()
			elif odd:
				odd.pop()
		elif even and odd:
			if even[-1] > odd[-1]:
				even.pop()
			else:
				bob += odd.pop()
		elif even:
			even.pop()
		else:
			bob += odd.pop()
		turn ^= True
	if alice == bob:
		out('Tie')
		continue
	out(('Alice', 'Bob')[bob > alice])


def solve(arr, n):
	(A, B, turn) = (0, 0, True)
	arr.sort()
	for i in range(n - 1, -1, -1):
		if turn and arr[i] % 2 == 0:
			A += arr[i]
		elif not turn and arr[i] % 2 == 1:
			B += arr[i]
		turn = not turn
	if A > B:
		return 'Alice'
	elif B > A:
		return 'Bob'
	else:
		return 'Tie'
tc = int(input())
for _ in range(tc):
	n = int(input())
	arr = list(map(int, input().split()))
	print(solve(arr, n))


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	count = 0
	for i in range(n):
		if i % 2 == 0:
			if l[n - 1 - i] % 2 == 0:
				count += l[n - 1 - i]
		elif l[n - 1 - i] % 2 == 1:
			count -= l[n - 1 - i]
	if count == 0:
		print('Tie')
	elif count > 0:
		print('Alice')
	else:
		print('Bob')


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort(reverse=True)
	s1 = 0
	s2 = 0
	for i in range(n):
		if i % 2 == 0 and a[i] % 2 == 0:
			s1 += a[i]
		elif i % 2 == 1 and a[i] % 2 == 1:
			s2 += a[i]
	if s1 > s2:
		print('Alice')
	elif s1 < s2:
		print('Bob')
	else:
		print('Tie')


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort(reverse=True)
	bo = 0
	al = 0
	c = 0
	for i in l:
		if c % 2 == 0:
			if i % 2 == 0:
				al = al + i
		elif i % 2 != 0:
			bo = bo + i
		c = c + 1
	if al > bo:
		print('Alice')
	elif bo > al:
		print('Bob')
	else:
		print('Tie')


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	(a1, b1) = (0, 0)
	(even, odd) = ([], [])
	for i in range(n):
		if l[i] & 1:
			odd.append(l[i])
		else:
			even.append(l[i])
	even.sort(reverse=True)
	odd.sort(reverse=True)
	c = 0
	(i, j) = (0, 0)
	while i < len(even) or j < len(odd):
		if c % 2 == 0:
			if i >= len(even):
				j += 1
			elif j >= len(odd):
				a1 += even[i]
				i += 1
			elif even[i] < odd[j]:
				a1 += 0
				j += 1
			else:
				a1 += even[i]
				i += 1
		elif j >= len(odd):
			i += 1
		elif i >= len(even):
			b1 += odd[j]
			j += 1
		elif even[i] > odd[j]:
			b1 += 0
			i += 1
		else:
			b1 += odd[j]
			j += 1
		c += 1
	if a1 == b1:
		print('Tie')
	elif a1 > b1:
		print('Alice')
	else:
		print('Bob')


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	e = []
	o = []
	ce = 0
	co = 0
	for i in l:
		if i % 2 == 1:
			o.append(i)
			co += 1
		else:
			e.append(i)
			ce += 1
	o.sort(reverse=True)
	e.sort(reverse=True)
	a = 0
	b = 0
	i = 0
	j = 0
	t = 0
	while i + j < n:
		if i == ce:
			if t == 0:
				j += 1
			else:
				b += o[j]
				j += 1
		elif j == co:
			if t == 0:
				a += e[i]
				i += 1
			else:
				i += 1
		elif t == 0:
			if e[i] > o[j]:
				a += e[i]
				i += 1
			else:
				j += 1
		elif e[i] < o[j]:
			b += o[j]
			j += 1
		else:
			i += 1
		if t == 0:
			t = 1
		else:
			t = 0
	if a == b:
		print('Tie')
	elif a > b:
		print('Alice')
	else:
		print('Bob')


t = int(input())
for q in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	a = list(reversed(sorted(a)))
	alice = 0
	bob = 0
	for (i, j) in enumerate(a):
		if i % 2 == 0:
			if j % 2 == 0:
				alice += j
		if i % 2 == 1:
			if j % 2 == 1:
				bob += j
	if alice > bob:
		print('Alice')
	elif bob > alice:
		print('Bob')
	else:
		print('Tie')


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a = sorted(a, reverse=True)
	c = 0
	players = [0, 0]
	for num in a:
		if c % 2 == 0:
			players[0] += num if num % 2 == 0 else 0
		else:
			players[1] += num if num % 2 == 1 else 0
		c += 1
	if players[0] > players[1]:
		print('Alice')
	elif players[0] == players[1]:
		print('Tie')
	else:
		print('Bob')


t = int(input())
while t > 0:
	n = int(input())
	arr = [int(i) for i in input().split()]
	arr.sort()
	is_alice_turn = True
	alice_points = 0
	bob_points = 0
	while n > 0:
		if is_alice_turn:
			is_alice_turn = False
			picked = arr.pop()
			if picked % 2 == 0:
				alice_points = alice_points + picked
		else:
			is_alice_turn = True
			picked = arr.pop()
			if picked % 2 == 1:
				bob_points = bob_points + picked
		n = n - 1
	if bob_points > alice_points:
		print('Bob')
	elif alice_points > bob_points:
		print('Alice')
	else:
		print('Tie')
	t = t - 1


test_cases = int(input())
for x in range(test_cases):
	a = 0
	b = 0
	i = int(input())
	l = list(map(int, input().split()))
	l = sorted(l)
	for move in range(1, len(l) + 1):
		n = l.pop()
		if move % 2 == 0 and n % 2 != 0:
			b += n
		elif move % 2 != 0 and n % 2 == 0:
			a += n
	if a > b:
		print('Alice')
	elif a == b:
		print('Tie')
	else:
		print('Bob')


def map_int_input(prompt=''):
	return map(int, input(prompt).split())

def list_int_input(prompt=''):
	return list(map(int, input(prompt).split()))

def run_prog():
	for _ in range(int(input())):
		n = int(input())
		l = list_int_input()
		o = sorted([i for i in l if i % 2 == 1])
		e = sorted([i for i in l if i % 2 == 0])
		(a, b) = (0, 0)
		for i in range(n):
			if i % 2 == 0:
				if len(o) > 0 and len(e) > 0:
					if e[-1] < o[-1]:
						o.pop()
					else:
						a += e[-1]
						e.pop()
				elif len(o) == 0:
					a += e[-1]
					e.pop()
				else:
					o.pop()
			elif len(o) > 0 and len(e) > 0:
				if o[-1] < e[-1]:
					e.pop()
				else:
					b += o[-1]
					o.pop()
			elif len(e) == 0:
				b += o[-1]
				o.pop()
			else:
				e.pop()
		if a > b:
			print('Alice')
		elif a < b:
			print('Bob')
		else:
			print('Tie')
try:
	run_prog()
except:
	pass


import sys
t = int(sys.stdin.readline().strip())
for _ in range(t):
	n = int(sys.stdin.readline().strip())
	a = list(map(int, sys.stdin.readline().split()))
	ev = []
	od = []
	for j in a:
		if j % 2 == 0:
			ev.append(j)
		else:
			od.append(j)
	ev.sort()
	od.sort()
	ans1 = 0
	ans2 = 0
	turn = True
	while len(ev) > 0 or len(od) > 0:
		if turn:
			if len(ev) > 0 and len(od) > 0:
				if ev[-1] > od[-1]:
					ans1 += ev[-1]
					ev.pop(-1)
				else:
					od.pop(-1)
			elif len(ev) > 0:
				ans1 += ev[-1]
				ev.pop(-1)
			else:
				od.pop(-1)
			turn = False
		else:
			if len(ev) > 0 and len(od) > 0:
				if ev[-1] > od[-1]:
					ev.pop(-1)
				else:
					ans2 += od[-1]
					od.pop(-1)
			elif len(ev) > 0:
				ev.pop(-1)
			else:
				ans2 += od[-1]
				od.pop(-1)
			turn = True
	if ans1 == ans2:
		print('Tie')
	elif ans1 > ans2:
		print('Alice')
	else:
		print('Bob')


import sys
input = sys.stdin.readline
getint = lambda : int(input())
getints = lambda : [int(a) for a in input().split()]

def solve(n, a):
	a = sorted(a, reverse=True)
	point = [0, 0]
	for i in range(n):
		if i % 2 == 0:
			if a[i] % 2 == 0:
				point[0] += a[i]
		elif a[i] % 2 == 1:
			point[1] += a[i]
	if point[0] > point[1]:
		print('Alice')
	elif point[0] < point[1]:
		print('Bob')
	else:
		print('Tie')
t = getint()
for i in range(t):
	n = getint()
	a = getints()
	solve(n, a)


test_case = int(input())
for i in range(0, test_case):
	test = int(input())
	array_list = []
	num = list(map(int, input().strip().split()))[:test]
	ans = 0
	num.sort(reverse=True)
	for n in range(0, test):
		if n % 2 == 0:
			if num[n] % 2 == 0:
				ans += num[n]
		elif num[n] % 2 == 1:
			ans -= num[n]
	if ans == 0:
		print('Tie')
	elif ans > 0:
		print('Alice')
	else:
		print('Bob')


for _ in range(int(input())):
	(n, l, w, j) = (int(input()), list(map(int, input().split())), 0, 0)
	l.sort(reverse=1)
	for i in range(n):
		if l[i] % 2 == 0:
			if ~j:
				w += l[i]
		elif j:
			w -= l[i]
		j = ~j
	print('Alice' * (w > 0) + 'Tie' * (w == 0) + 'Bob' * (w < 0))


for _ in range(int(input())):
	n = int(input())
	a = sorted(map(int, input().split()))[::-1]
	(q, w, t) = (0, 0, 1)
	for i in range(n):
		if t and a[i] % 2 == 0:
			q += a[i]
		elif t == 0 and a[i] % 2:
			w += a[i]
		t = 1 - t
	if w > q:
		print('Bob')
	elif q > w:
		print('Alice')
	else:
		print('Tie')


from heapq import heappush, heappop

def solve_slow(l):
	n = len(l)
	o = []
	e = []
	for ele in l:
		if ele % 2 == 0:
			heappush(e, -ele)
		else:
			heappush(o, -ele)
	(a, b) = (0, 0)
	for i in range(n):
		if i % 2 == 0:
			if e and o:
				if -e[0] > -o[0]:
					a -= heappop(e)
				else:
					heappop(o)
			elif e:
				a -= heappop(e)
			else:
				heappop(o)
		elif e and o:
			if -o[0] > -e[0]:
				b -= heappop(o)
			else:
				heappop(e)
		elif o:
			b -= heappop(o)
		else:
			heappop(e)
	if a > b:
		return 'Alice'
	elif b > a:
		return 'Bob'
	return 'Tie'

def solve(l):
	n = len(l)
	s = sorted(l)
	s = s[::-1]
	(a, b) = (0, 0)
	for i in range(n):
		if i % 2 == 0:
			a = a + s[i] if s[i] % 2 == 0 else a
		else:
			b = b + s[i] if s[i] % 2 == 1 else b
	if a > b:
		return 'Alice'
	elif b > a:
		return 'Bob'
	return 'Tie'

def main():
	p = int(input())
	for i in range(p):
		_ = input()
		l = [int(_) for _ in input().split()]
		print(solve(l))
main()


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort(reverse=True)
	i = 0
	alice = 0
	bob = 0
	while i < len(arr):
		if arr[i] % 2 == 0:
			alice += arr[i]
		i += 2
	i = 1
	while i < len(arr):
		if arr[i] & 1:
			bob += arr[i]
		i += 2
	if alice == bob:
		print('Tie')
	elif alice > bob:
		print('Alice')
	else:
		print('Bob')


from collections import defaultdict
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort(reverse=True)
	(c1, c2) = (0, 0)
	for i in range(n):
		if i % 2 == 0:
			if a[i] % 2 == 0:
				c1 += a[i]
		elif a[i] % 2 == 1:
			c2 += a[i]
	if c1 == c2:
		print('Tie')
	elif c1 > c2:
		print('Alice')
	else:
		print('Bob')


t = int(input())
for te in range(t):
	n = int(input())
	arr = list(map(int, input().split(' ')))
	al = 0
	bo = 0
	arr.sort()
	l = n // 2
	for i in range(1, l + 1):
		if arr[-2 * i + 1] % 2 == 0:
			al += arr[-2 * i + 1]
		if arr[-2 * i] % 2 != 0:
			bo += arr[-2 * i]
	if n % 2 != 0 and arr[0] % 2 == 0:
		al += arr[0]
	if al == bo:
		print('Tie')
	elif al > bo:
		print('Alice')
	else:
		print('Bob')


def take_input():
	length = int(input())
	(*numbers,) = map(int, input().split())
	return (length, numbers)

def even_odd_game(length, numbers):
	alice = 0
	bob = 0
	numbers = sorted(numbers, reverse=True)
	for i in range(length):
		if not i % 2:
			alice = alice + numbers[i] if not numbers[i] % 2 else alice
		else:
			bob = bob + numbers[i] if numbers[i] % 2 else bob
	if alice > bob:
		return 'Alice'
	elif alice < bob:
		return 'Bob'
	else:
		return 'Tie'
query_size = int(input())
for _ in range(query_size):
	vals = take_input()
	print(even_odd_game(*vals))


for _ in range(int(input())):
	(n, sc, sl) = (int(input()), 0, 0)
	a = sorted(list(map(int, input().split())), reverse=True)
	for i in range(n):
		if i % 2 == 0 and a[i] % 2 == 0:
			sc += a[i]
		elif i % 2 != 0 and a[i] % 2 != 0:
			sl += a[i]
	if sc > sl:
		print('Alice')
	elif sc < sl:
		print('Bob')
	else:
		print('Tie')


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')
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
from math import *
from itertools import *
from collections import Counter

def aa():
	return int(input())

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

def cc():
	s = input()
	return list(s)

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

def solve():
	n = aa()
	arr = sorted(bb(), reverse=True)
	alice = 0
	bob = 0
	for (i, v) in enumerate(arr):
		if i % 2 == 0 and v % 2 == 0:
			alice += v
		elif i % 2 == 1 and v % 2 == 1:
			bob += v
	if alice > bob:
		print('Alice')
	elif alice < bob:
		print('Bob')
	else:
		print('Tie')
t = aa()
while t:
	solve()
	t -= 1


for _ in range(int(input())):
	n = int(input())
	s = input().split()
	e = []
	o = []
	for i in s:
		u = int(i)
		if u & 1 == 0:
			e.append(u)
		else:
			o.append(u)
	e.sort()
	o.sort()
	a_s = 0
	b_s = 0
	k = 0
	while len(e) != 0 and len(o) != 0:
		if k == 0:
			k = 1
			if e[-1] >= o[-1]:
				a_s += e[-1]
				e.pop()
			else:
				o.pop()
		else:
			k = 0
			if e[-1] > o[-1]:
				e.pop()
			else:
				b_s += o[-1]
				o.pop()
	while len(e) != 0:
		if k == 0:
			k = 1
			a_s += e[-1]
			e.pop()
		else:
			k = 0
			e.pop()
	while len(o) != 0:
		if k == 0:
			k = 1
			o.pop()
		else:
			k = 0
			b_s += o[-1]
			o.pop()
	if a_s == b_s:
		print('Tie')
	elif a_s > b_s:
		print('Alice')
	else:
		print('Bob')


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):
	n = int(z())
	arr = szzz()[::-1]
	(a, b) = (0, 0)
	for i in range(n):
		if i % 2 == 0:
			if arr[i] % 2 == 0:
				a += arr[i]
		elif arr[i] % 2:
			b += arr[i]
	if a == b:
		print('Tie')
	elif a > b:
		print('Alice')
	else:
		print('Bob')


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort(reverse=True)
	even = []
	odd = []
	for i in range(n):
		if i % 2 == 0:
			if a[i] % 2 == 0:
				even.append(a[i])
		elif a[i] % 2 != 0:
			odd.append(a[i])
	sum1 = sum(even)
	sum2 = sum(odd)
	if sum1 == sum2:
		print('Tie')
	elif sum1 > sum2:
		print('Alice')
	else:
		print('Bob')


t = int(input())
for _ in range(t):
	n = int(input())
	li = list(map(int, input().split()))
	alice = []
	bob = []
	for i in range(n):
		if li[i] % 2:
			bob.append(li[i])
		else:
			alice.append(li[i])
	alice.sort(reverse=True)
	bob.sort(reverse=True)
	flag = True
	ap = 0
	bp = 0
	sa = 0
	sb = 0
	while True:
		if ap == len(alice) and bp == len(bob):
			break
		if flag:
			if ap == len(alice):
				bp += 1
			elif bp == len(bob):
				sa += alice[ap]
				ap += 1
			elif alice[ap] >= bob[bp]:
				sa += alice[ap]
				ap += 1
			else:
				bp += 1
		elif ap == len(alice):
			sb += bob[bp]
			bp += 1
		elif bp == len(bob):
			ap += 1
		elif alice[ap] <= bob[bp]:
			sb += bob[bp]
			bp += 1
		else:
			ap += 1
		flag = not flag
	if sb > sa:
		print('Bob')
	elif sa > sb:
		print('Alice')
	else:
		print('Tie')


from math import *
from math import factorial as fact, comb as ncr
from bisect import bisect_left as bl
from bisect import bisect_right as br
from collections import Counter as ctr
from collections import deque as dq
from array import array
from re import search
li = lambda : list(map(int, input().split()))
arr = lambda a: array('i', a)
bi = lambda n: bin(n).replace('0b', '')
yn = lambda f: print('NYOE S'[f::2])
sbstr = lambda a, s: search('.*'.join(a), s)

def solve():
	for _ in range(int(input())):
		n = int(input())
		a = li()
		a.sort(reverse=True)
		s = 0
		for i in range(n):
			if i % 2:
				if i % 2 == a[i] % 2:
					s -= a[i]
			elif i % 2 == a[i] % 2:
				s += a[i]
		if s > 0:
			print('Alice')
		elif s == 0:
			print('Tie')
		else:
			print('Bob')
solve()


from collections import defaultdict
tests = int(input())
for t in range(tests):
	n = int(input())
	ls = list(map(int, input().split()))
	ls = sorted(ls)[::-1]
	idx = 0
	a = 0
	b = 0
	while idx < len(ls):
		if ls[idx] % 2 == 0:
			a += ls[idx]
		idx += 1
		if idx == len(ls):
			break
		if ls[idx] % 2 == 1:
			b += ls[idx]
		idx += 1
	if a == b:
		print('Tie')
	elif a > b:
		print('Alice')
	else:
		print('Bob')


import os.path
from math import gcd, floor, ceil
from collections import *
import sys
mod = 1000000007
INF = float('inf')

def st():
	return list(sys.stdin.readline().strip())

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

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

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

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

def prl(n):
	return sys.stdout.write(str(n) + ' ')
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def solve():
	n = inp()
	l = li()
	odd = []
	even = []
	l.sort()
	(f, s) = (0, 0)
	for i in l:
		if i & 1:
			odd.append(i)
		else:
			even.append(i)
	turn = 1
	while odd and even:
		if turn:
			if even[-1] > odd[-1]:
				f += even[-1]
				even.pop()
			else:
				odd.pop()
		elif odd[-1] > even[-1]:
			s += odd[-1]
			odd.pop()
		else:
			even.pop()
		turn ^= 1
	while even:
		if turn:
			f += even[-1]
		turn ^= 1
		even.pop()
	while odd:
		if not turn:
			s += odd[-1]
		turn ^= 1
		odd.pop()
	if f == s:
		pr('Tie')
	elif f > s:
		pr('Alice')
	else:
		pr('Bob')
for _ in range(inp()):
	solve()


t = int(input())
for _ in range(t):
	n = int(input())
	A = list(map(int, input().split()))
	c = []
	nc = []
	i = 0
	LC = 0
	LNC = 0
	while i < n:
		if A[i] % 2 == 0:
			c.append(A[i])
			LC += 1
		else:
			nc.append(A[i])
			LNC += 1
		i += 1
	c.sort()
	nc.sort()
	A = 0
	B = 0
	IC = LC - 1
	INC = LNC - 1
	while IC > -1 or INC > -1:
		if IC <= -1:
			INC -= 1
			if INC > -1:
				B += nc[INC]
				INC -= 1
		elif INC <= -1:
			A += c[IC]
			IC -= 2
		elif c[IC] > nc[INC]:
			A += c[IC]
			IC -= 1
			if IC > -1:
				if c[IC] > nc[INC]:
					IC -= 1
				else:
					B += nc[INC]
					INC -= 1
			else:
				B += nc[INC]
				INC -= 1
		else:
			INC -= 1
			if INC > -1:
				if c[IC] > nc[INC]:
					IC -= 1
				else:
					B += nc[INC]
					INC -= 1
			else:
				IC -= 1
	if A == B:
		print('Tie')
	elif A > B:
		print('Alice')
	else:
		print('Bob')


def askeladd(l):
	(rena, keichi) = (0, 0)
	l = list(sorted(l))[::-1]
	for n in range(len(l)):
		if n % 2 == 0:
			if l[n] % 2 == 0:
				rena += l[n]
		elif l[n] % 2 != 0:
			keichi += l[n]
	if rena > keichi:
		return 'Alice'
	elif rena == keichi:
		return 'Tie'
	else:
		return 'Bob'
for n in range(int(input())):
	m = input()
	k = input().split()
	h = list(map(int, k))
	print(askeladd(h))


t = int(input())
for i in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	arr = sorted(arr, reverse=True)
	ans = 0
	for i in range(n):
		if i % 2 == 0:
			if arr[i] % 2 == 0:
				ans += arr[i]
		elif arr[i] % 2 != 0:
			ans -= arr[i]
	if ans == 0:
		print('Tie')
	elif ans > 0:
		print('Alice')
	else:
		print('Bob')


t = int(input())
for i in range(t):
	n = int(input())
	(*a,) = map(int, input().split())
	a.sort()
	k = 0
	B = 0
	A = 0
	for j in reversed(a):
		if k:
			B += j * (j % 2)
			k = 0
		else:
			A += j * (1 - j % 2)
			k = 1
	if A > B:
		print('Alice')
	elif A == B:
		print('Tie')
	else:
		print('Bob')


t = int(input())
for i in range(0, t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort(reverse=True)
	alice = 0
	bob = 0
	player = 0
	for x in a:
		if player == 0:
			player = 1
			if x % 2 == 0:
				alice = alice + x
		else:
			player = 0
			if x % 2 == 1:
				bob = bob + x
	if bob > alice:
		print('Bob')
	elif alice > bob:
		print('Alice')
	else:
		print('Tie')


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	(Alice, Bob) = (0, 0)
	arr = sorted(arr)
	k = True
	for i in range(1, n + 1):
		if k:
			if arr[-i] % 2 == 0:
				Alice += arr[-i]
			k = False
		else:
			if arr[-i] % 2 == 1:
				Bob += arr[-i]
			k = True
	if Alice == Bob:
		print('Tie')
	elif Alice < Bob:
		print('Bob')
	else:
		print('Alice')


inp = open(0).readlines()
for tc in range(int(inp[0])):
	a = [0, 0]
	for (i, x) in enumerate(sorted(map(int, inp[tc + 1 << 1].split()), reverse=True)):
		if i & 1 == x & 1:
			a[i & 1] += x
	if a[0] == a[1]:
		print('Tie')
	elif a[0] > a[1]:
		print('Alice')
	else:
		print('Bob')


for _ in range(int(input())):
	n = int(input())
	arr = sorted(map(int, input().split()), reverse=True)
	alice = 0
	bob = 0
	turn = True
	for i in arr:
		if i % 2 == 0:
			if turn == True:
				alice += i
				turn = False
			else:
				turn = True
				continue
		elif turn == False:
			bob += i
			turn = True
		else:
			turn = False
			continue
	if alice == bob:
		print('Tie')
	elif alice > bob:
		print('Alice')
	else:
		print('Bob')


for _ in range(int(input())):
	n = int(input())
	a = []
	a = list(map(int, input().split()))
	a.sort(reverse=True)
	i = 0
	od = 0
	ev = 0
	while i < n:
		if a[i] % 2 == 0:
			ev += a[i]
			i += 1
		else:
			i += 1
		if i >= n:
			break
		if a[i] % 2 != 0:
			od += a[i]
			i += 1
		else:
			i += 1
	if ev > od:
		print('Alice')
	elif od > ev:
		print('Bob')
	else:
		print('Tie')


t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	a = sorted(a, reverse=True)
	alice = 0
	bob = 0
	for i in range(len(a)):
		if i % 2 == 0:
			if a[i] % 2 == 0:
				alice += a[i]
		elif a[i] % 2 == 1:
			bob += a[i]
	if alice > bob:
		print('Alice')
	elif alice == bob:
		print('Tie')
	else:
		print('Bob')


for _ in range(int(input())):
	x = 0
	y = 0
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	a.reverse()
	for i in range(len(a)):
		if i % 2 == 0 or i == 0:
			if a[i] % 2 == 0:
				x += a[i]
		elif a[i] % 2 == 1:
			y += a[i]
	if x > y:
		print('Alice')
	elif x < y:
		print('Bob')
	else:
		print('Tie')


for _ in range(int(input())):
	(n, c) = (int(input()), 0)
	l = sorted(map(int, input().split()))[::-1]
	for i in range(n):
		if i % 2 == 0:
			if l[i] % 2 == 0:
				c += l[i]
		elif l[i] % 2 != 0:
			c -= l[i]
	if c > 0:
		print('Alice')
	elif c < 0:
		print('Bob')
	else:
		print('Tie')


from itertools import repeat

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

def num():
	return int(input())
t = num()
for _ in repeat(None, t):
	n = num()
	ass = sorted(line())[::-1]
	(alice, bob) = (0, 0)
	for (i, x) in enumerate(ass):
		if not i % 2 and (not x % 2):
			alice += x
		elif i % 2 and x % 2:
			bob += x
	if alice > bob:
		print('Alice')
	elif alice < bob:
		print('Bob')
	else:
		print('Tie')


lines = open(0).readlines()
n = int(lines[0])
for i in range(2, 2 + 2 * n, 2):
	l = list(map(int, lines[i].split()))
	l = sorted(l, reverse=True)
	scores = [0, 0]
	for (j, elem) in enumerate(l):
		if (j + elem) % 2 == 0:
			scores[j % 2] += elem
	if scores[0] > scores[1]:
		print('Alice')
	elif scores[1] > scores[0]:
		print('Bob')
	else:
		print('Tie')


for p in range(int(input())):
	(n, s) = (int(input()), 0)
	l = list(map(int, input().split()))
	l.sort(reverse=True)
	for i in range(n):
		if i % 2:
			if l[i] % 2:
				s -= l[i]
		elif l[i] % 2 == 0:
			s += l[i]
	if s > 0:
		print('Alice')
	elif s < 0:
		print('Bob')
	else:
		print('Tie')