Chef is the judge of a competition. There are two players participating in this competition — Alice and Bob.
The competition consists of N races. For each i (1 ≤ i ≤ N), Alice finished the i-th race in Ai minutes, while Bob finished it in Bi minutes. The player with the smallest sum of finish times wins. If this total time is the same for Alice and for Bob, a draw is declared.
The rules of the competition allow each player to choose a race which will not be counted towards their total time. That is, Alice may choose an index x and her finish time in the race with this index will be considered zero; similarly, Bob may choose an index y and his finish time in the race with this index will be considered zero. Note that x can be different from y; the index chosen by Alice does not affect Bob's total time or vice versa.
Chef, as the judge, needs to announce the result of the competition. He knows that both Alice and Bob play optimally and will always choose the best option. Please help Chef determine the result!

-----Input-----
- The first line of the input contains a single integer T denoting the number of test cases. The description of T test cases follows.
- The first line of each test case contains a single integer N.
- The second line contains N space-separated integers A1, A2, ..., AN.
- The third line contains N space-separated integers B1, B2, ..., BN.

-----Output-----
For each test case, print a single line containing the string "Alice" if Alice wins, "Bob" if Bob wins or "Draw" if the result is a draw (without quotes).

-----Constraints-----
- 1 ≤ T ≤ 100
- 2 ≤ N ≤ 100
- 1 ≤ Ai ≤ 1000 for each valid i
- 1 ≤ Bi ≤ 1000 for each valid i

-----Example-----
Input:

3
5
3 1 3 3 4
1 6 2 5 3
5
1 6 2 5 3
3 1 3 3 4
3
4 1 3
2 2 7

Output:

Alice
Bob
Draw

-----Explanation-----
Example case 1: Alice will choose the finish time in the last race to be considered zero, which means her sum of finish times is 3 + 1 + 3 + 3 + 0 = 10, while Bob will choose the finish time of his second race to be considered zero, so his total sum of finish times is 1 + 0 + 2 + 5 + 3 = 11. Since Alice's sum is smaller, she is considered the winner.
Example case 2: We're dealing with the same situation as in the previous case, but finish times for the players are swapped, so Bob wins this time.
Example case 3: Alice will choose the finish time of the first race to be considered zero, which means her total time is 0 + 1 + 3 = 4. Bob will choose the finish time of his last race to be considered zero, which makes his total time 2 + 2 + 0 = 4. The competition is considered a draw because both players have equal sums of finish times.

Difficulty: EASY
Tags: Constructive algorithms

Ad-hoc

Starter code:

Solutions:
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	a.sort()
	b.sort()
	s = 0
	for i in range(len(a) - 1):
		s += a[i]
	t = 0
	for i in range(len(b) - 1):
		t += b[i]
	if s == t:
		print('Draw')
	elif s < t:
		print('Alice')
	else:
		print('Bob')


T = int(input())
for _ in range(T):
	N = int(input())
	A = list(map(int, input().split()))
	B = list(map(int, input().split()))
	(Alice, Bob) = (sum(A) - max(A), sum(B) - max(B))
	if Alice < Bob:
		print('Alice')
	elif Alice > Bob:
		print('Bob')
	else:
		print('Draw')


t = int(input())
for i in range(t):
	n = int(input())
	r = list(map(int, input().split()))
	r1 = list(map(int, input().split()))
	a = sum(r) - max(r)
	bs = sum(r1) - max(r1)
	if a > bs:
		print('Bob')
	elif a == bs:
		print('Draw')
	else:
		print('Alice')


for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	a.sort()
	b.sort()
	print('Alice' if sum(a) - a[-1] < sum(b) - b[-1] else 'Bob' if sum(a) - a[-1] > sum(b) - b[-1] else 'Draw')


t = int(input())
for _ in range(t):
	n = int(input())
	alice = list(map(int, input().split()))
	bob = list(map(int, input().split()))
	alice.sort()
	bob.sort()
	if sum(alice[:n - 1]) < sum(bob[:n - 1]):
		print('Alice')
	elif sum(alice[:n - 1]) > sum(bob[:n - 1]):
		print('Bob')
	else:
		print('Draw')


t = int(input())
for _ in range(t):
	N = int(input())
	A = list(map(int, input().split(' ')))
	B = list(map(int, input().split(' ')))
	X = sum(A) - max(A)
	Y = sum(B) - max(B)
	if X > Y:
		print('Bob')
	elif X == Y:
		print('Draw')
	else:
		print('Alice')


for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	suma = sum(a) - max(a)
	sumb = sum(b) - max(b)
	if suma == sumb:
		print('Draw')
	elif suma > sumb:
		print('Bob')
	else:
		print('Alice')


for t in range(int(input())):
	ab = int(input())
	a = list(map(int, input().split()))
	c = list(map(int, input().split()))
	b = 0
	e = 0
	a.sort()
	for i in range(len(a) - 1):
		b += a[i]
	c.sort()
	for i in range(len(c) - 1):
		e += c[i]
	if b < e:
		print('Alice')
	elif b == e:
		print('Draw')
	else:
		print('Bob')


for i in range(int(input())):
	N = int(input())
	A = list(map(int, input().split()))
	B = list(map(int, input().split()))
	A.sort()
	B.sort()
	A.pop()
	B.pop()
	if sum(A) > sum(B):
		print('Bob')
	elif sum(A) < sum(B):
		print('Alice')
	else:
		print('Draw')


for i in range(int(input())):
	n = int(input())
	l1 = sorted(list(map(int, input().split())))
	l2 = sorted(list(map(int, input().split())))
	l1.pop(-1)
	l2.pop(-1)
	if sum(l1) > sum(l2):
		print('Bob')
	elif sum(l1) < sum(l2):
		print('Alice')
	else:
		print('Draw')


for _ in range(int(input())):
	n = int(input())
	a1 = list(map(int, input().split()))
	b1 = list(map(int, input().split()))
	a = sum(a1) - max(a1)
	b = sum(b1) - max(b1)
	if a > b:
		print('Bob')
	elif b > a:
		print('Alice')
	else:
		print('Draw')


a = int(input())
while a:
	a = a - 1
	b = int(input())
	x = list(map(int, input().split()))
	y = list(map(int, input().split()))
	h = sum(x) - max(x)
	g = sum(y) - max(y)
	if h < g:
		print('Alice')
	elif g < h:
		print('Bob')
	else:
		print('Draw')


for t in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	x = sum(a) - max(a)
	y = sum(b) - max(b)
	if x > y:
		print('Bob')
	elif x < y:
		print('Alice')
	else:
		print('Draw')


t = int(input())
for i in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	arr1 = list(map(int, input().split()))
	a = sum(arr) - max(arr)
	bs = sum(arr1) - max(arr1)
	if a > bs:
		print('Bob')
	elif a == bs:
		print('Draw')
	else:
		print('Alice')


for i in range(int(input())):
	n = int(input())
	alice = list(map(int, input().split()))
	bob = list(map(int, input().split()))
	alice.remove(max(alice))
	bob.remove(max(bob))
	if sum(alice) > sum(bob):
		print('Bob')
	elif sum(alice) < sum(bob):
		print('Alice')
	else:
		print('Draw')


t = int(input())
for i in range(t):
	N = int(input())
	A = list(map(int, input().split()))
	B = list(map(int, input().split()))
	A.remove(max(A))
	B.remove(max(B))
	alice = sum(A)
	bob = sum(B)
	if alice > bob:
		print('Bob')
	elif alice < bob:
		print('Alice')
	else:
		print('Draw')


for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	maxa = max(a)
	maxb = max(b)
	c = 0
	d = 0
	for j in range(n):
		c += a[j]
		d += b[j]
	c = c - maxa
	d = d - maxb
	if c > d:
		print('Bob')
	elif d > c:
		print('Alice')
	else:
		print('Draw')


t = int(input())
for i in range(t):
	n = int(input())
	alice_time = list(map(int, input().split()))
	bob_time = list(map(int, input().split()))
	alice_time.pop(alice_time.index(max(alice_time)))
	bob_time.pop(bob_time.index(max(bob_time)))
	alice_tot_time = sum(alice_time)
	bob_tot_time = sum(bob_time)
	if alice_tot_time > bob_tot_time:
		print('Bob')
	elif alice_tot_time < bob_tot_time:
		print('Alice')
	else:
		print('Draw')


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	a.remove(max(a))
	b.remove(max(b))
	l = sum(a)
	m = sum(b)
	if l > m:
		print('Bob')
	elif l < m:
		print('Alice')
	else:
		print('Draw')


t = int(input())
for i in range(t):
	a = int(input())
	b = [int(b) for b in input().split()]
	c = [int(c) for c in input().split()]
	if sum(b) - max(b) > sum(c) - max(c):
		print('Bob')
	elif sum(b) - max(b) < sum(c) - max(c):
		print('Alice')
	else:
		print('Draw')


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	a_max = max(a)
	b_max = max(b)
	for i in range(n):
		if a[i] == a_max:
			t_a = i
	for i in range(n):
		if b[i] == b_max:
			t_b = i
	sum_a = sum(a) - a[t_a]
	sum_b = sum(b) - b[t_b]
	if sum_a > sum_b:
		print('Bob')
	elif sum_a < sum_b:
		print('Alice')
	else:
		print('Draw')


for i in range(int(input())):
	N = int(input())
	ALICE = list(map(int, input().split()))
	BOB = list(map(int, input().split()))
	ALICE[ALICE.index(max(ALICE))] = 0
	BOB[BOB.index(max(BOB))] = 0
	if sum(ALICE) < sum(BOB):
		print('Alice')
	elif sum(BOB) < sum(ALICE):
		print('Bob')
	else:
		print('Draw')


for _ in range(int(input())):
	c = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	a = sum(a) - max(a)
	b = sum(b) - max(b)
	if a < b:
		print('Alice')
	elif a > b:
		print('Bob')
	else:
		print('Draw')


t = int(input())
for i in range(t):
	n = int(input())
	alice = list(map(int, input().split()))
	bob = list(map(int, input().split()))
	a = sum(alice) - max(alice)
	b = sum(bob) - max(bob)
	if a < b:
		print('Alice')
	elif a > b:
		print('Bob')
	else:
		print('Draw')


for _ in range(int(input())):
	n = int(input())
	a = [int(i) for i in input().split()]
	b = [int(i) for i in input().split()]
	if sum(a) - max(a) < sum(b) - max(b):
		print('Alice')
	elif sum(a) - max(a) == sum(b) - max(b):
		print('Draw')
	else:
		print('Bob')


Test = int(input())
for Cases in range(Test):
	NumberofRaces = int(input())
	AliceFinishTime = list(map(int, input().split()))
	BobFinishTime = list(map(int, input().split()))
	AliceMaxFinishTime = max(AliceFinishTime)
	BobMaxFinishTime = max(BobFinishTime)
	AliceTotalFinishTime = sum(AliceFinishTime)
	BobTotalFinishTime = sum(BobFinishTime)
	FinalTimeAlice = AliceTotalFinishTime - AliceMaxFinishTime
	FinalTimeBob = BobTotalFinishTime - BobMaxFinishTime
	if FinalTimeAlice > FinalTimeBob:
		print('Bob')
	elif FinalTimeAlice == FinalTimeBob:
		print('Draw')
	else:
		print('Alice')


from array import *
t = int(input())
for i in range(t):
	N = int(input())
	a = [int(i) for i in input().split()]
	b = [int(i) for i in input().split()]
	z = 0
	for i in range(N):
		z = z + a[i]
	y = 0
	for i in range(N):
		y = y + b[i]
	w = a[0]
	for i in range(N):
		if w < a[i]:
			w = a[i]
	x = b[0]
	for i in range(N):
		if x < b[i]:
			x = b[i]
	if z - w < y - x:
		print('Alice')
	elif z - w > y - x:
		print('Bob')
	else:
		print('Draw')


for i in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l1 = list(map(int, input().split()))
	l.remove(max(l))
	l1.remove(max(l1))
	if sum(l) < sum(l1):
		print('Alice')
	elif sum(l) > sum(l1):
		print('Bob')
	else:
		print('Draw')


t = int(input())
for t in range(t):
	a = int(input())
	s1 = [int(x) for x in input().split()]
	s2 = [int(x) for x in input().split()]
	s1.remove(max(s1))
	s2.remove(max(s2))
	t1 = sum(s1)
	t2 = sum(s2)
	if t1 > t2:
		print('Bob')
	elif t1 < t2:
		print('Alice')
	else:
		print('Draw')


for i in range(int(input())):
	n = int(input())
	a = input().split()
	b = input().split()
	A = []
	B = []
	s1 = s2 = 0
	for k in a:
		x = int(k)
		s1 += x
		A.append(x)
	for k in b:
		x = int(k)
		s2 += x
		B.append(x)
	A.sort()
	B.sort()
	s1 -= A[-1]
	s2 -= B[-1]
	if s1 < s2:
		print('Alice')
	elif s2 < s1:
		print('Bob')
	else:
		print('Draw')


def find_max(lst):
	i = 0
	max = 0
	max_index = -1
	for i in range(len(lst)):
		if lst[i] > max:
			max = lst[i]
			max_index = i
	return max_index

def find_sum(lst, k):
	sum = 0
	i = 0
	while i in range(len(lst)):
		if k != i:
			sum += lst[i]
		i += 1
	return sum
t = int(input())
while t > 0:
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	x = find_max(a)
	y = find_max(b)
	sum_a = find_sum(a, x)
	sum_b = find_sum(b, y)
	if sum_a < sum_b:
		print('Alice')
	elif sum_a > sum_b:
		print('Bob')
	else:
		print('Draw')
	t -= 1


t = int(input())
for i in range(0, t):
	n = int(input())
	l1 = list(map(int, input().split()))
	l1.sort()
	l1[-1] = 0
	sum1 = 0
	for a in l1:
		sum1 += a
	l2 = list(map(int, input().split()))
	l2.sort()
	l2[-1] = 0
	sum2 = 0
	for b in l2:
		sum2 += b
	if sum1 < sum2:
		print('Alice')
	elif sum1 > sum2:
		print('Bob')
	else:
		print('Draw')


t = int(input())
for k in range(t):
	n = int(input())
	a = input().split()
	b = input().split()
	for j in range(n):
		a[j] = int(a[j])
		b[j] = int(b[j])
	a.remove(max(a))
	b.remove(max(b))
	s1 = sum(a)
	s2 = sum(b)
	if s1 > s2:
		print('Bob')
	elif s2 > s1:
		print('Alice')
	else:
		print('Draw')


n = int(input())
for _ in range(n):
	x = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	a.sort()
	b.sort()
	bob = 0
	alice = 0
	for i in range(x - 1):
		alice += a[i]
		bob += b[i]
	if alice < bob:
		print('Alice')
	elif bob < alice:
		print('Bob')
	else:
		print('Draw')


T = int(input())
for i in range(T):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	x = max(a)
	y = max(b)
	a.remove(x)
	b.remove(y)
	suma = 0
	sumb = 0
	for i in a:
		suma = suma + i
	for i in b:
		sumb = sumb + i
	if suma < sumb:
		print('Alice')
	elif suma > sumb:
		print('Bob')
	else:
		print('Draw')


def win(arr1, arr2, n):
	a = max(arr1)
	b = max(arr2)
	for ind in range(n):
		if arr1[ind] == a:
			index_a = ind
		if arr2[ind] == b:
			index_b = ind
	arr1[index_a] = 0
	arr2[index_b] = 0
	(sum_a, sum_b) = (0, 0)
	for i in range(n):
		sum_a += arr1[i]
	for j in range(n):
		sum_b += arr2[j]
	if sum_a < sum_b:
		print('Alice')
	elif sum_a > sum_b:
		print('Bob')
	else:
		print('Draw')
t = int(input())
for tc in range(t):
	n = int(input())
	arr1 = [int(ele) for ele in input().split()]
	arr2 = [int(ele) for ele in input().split()]
	win(arr1, arr2, n)


for _ in range(int(input())):
	n = int(input())
	l1 = list(map(int, input().split()))
	l2 = list(map(int, input().split()))
	s1 = s2 = 0
	max1 = max2 = 0
	for i in l1:
		if i > max1:
			max1 = i
		s1 += i
	for i in l2:
		if i > max2:
			max2 = i
		s2 += i
	s1 -= max1
	s2 -= max2
	if s1 < s2:
		print('Alice')
	elif s1 == s2:
		print('Draw')
	else:
		print('Bob')


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	ta = sum(a) - max(a)
	tb = sum(b) - max(b)
	if ta > tb:
		print('Bob')
	elif ta == tb:
		print('Draw')
	else:
		print('Alice')


for case in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	a_max_pos = a.index(max(a))
	a[a_max_pos] = 0
	b_max_pos = b.index(max(b))
	b[b_max_pos] = 0
	if sum(a) < sum(b):
		print('Alice')
	elif sum(b) < sum(a):
		print('Bob')
	else:
		print('Draw')


t = int(input())
for i in range(t):
	N = int(input())
	A = list(map(int, input().split()))
	B = list(map(int, input().split()))
	x = max(A)
	y = max(B)
	sum1 = sum(A) - x
	sum2 = sum(B) - y
	if sum1 < sum2:
		print('Alice')
	elif sum2 < sum1:
		print('Bob')
	else:
		print('Draw')


for _ in range(int(input())):
	n = int(input())
	maxa = 0
	maxb = 0
	suma = 0
	sumb = 0
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	for i in range(n):
		if a[i] > maxa:
			maxa = a[i]
		if b[i] > maxb:
			maxb = b[i]
		suma += a[i]
		sumb += b[i]
	suma -= maxa
	sumb -= maxb
	if suma < sumb:
		print('Alice')
	elif sumb < suma:
		print('Bob')
	else:
		print('Draw')


import math
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	x = sum(a) - max(a)
	y = sum(b) - max(b)
	if x < y:
		print('Alice')
	elif x > y:
		print('Bob')
	else:
		print('Draw')


a = []
b = []
c = []
for i in range(int(input())):
	a.append(int(input()))
	b.append(list(map(int, input().split())))
	c.append(list(map(int, input().split())))
for i in range(len(a)):
	if sum(b[i]) - max(b[i]) > sum(c[i]) - max(c[i]):
		print('Bob')
	elif sum(b[i]) - max(b[i]) < sum(c[i]) - max(c[i]):
		print('Alice')
	else:
		print('Draw')


t = int(input())
for i in range(t):
	N = int(input())
	alice = list(map(int, input().split()))
	bob = list(map(int, input().split()))
	am = max(alice)
	alice.remove(am)
	bm = max(bob)
	bob.remove(bm)
	sa = sum(alice)
	sb = sum(bob)
	if sa < sb:
		print('Alice')
	elif sa > sb:
		print('Bob')
	else:
		print('Draw')


t = int(input())
for r in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	x = max(a)
	y = max(b)
	z = sum(a)
	c = sum(b)
	k = z - x
	l = c - y
	if k < l:
		print('Alice')
	elif k > l:
		print('Bob')
	else:
		print('Draw')


for t in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	a_tot = sum(a) - max(a)
	b_tot = sum(b) - max(b)
	if a_tot < b_tot:
		print('Alice')
	elif b_tot < a_tot:
		print('Bob')
	else:
		print('Draw')


t = int(input())
for tc in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	a.remove(max(a))
	b.remove(max(b))
	s1 = sum(a)
	s2 = sum(b)
	if s1 > s2:
		print('Bob')
	elif s1 == s2:
		print('Draw')
	else:
		print('Alice')


for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a1 = list(map(int, input().split()))
	a = sum(a) - max(a)
	bs = sum(a1) - max(a1)
	if a > bs:
		print('Bob')
	elif a == bs:
		print('Draw')
	else:
		print('Alice')


T = int(input())
for _ in range(T):
	N = int(input())
	A = list(map(int, input().split()))
	B = list(map(int, input().split()))
	A.sort()
	B.sort()
	a = A[:len(A) - 1]
	b = B[:len(B) - 1]
	if sum(a) == sum(b):
		print('Draw')
	elif sum(a) < sum(b):
		print('Alice')
	else:
		print('Bob')


a = int(input())
for i in range(a):
	k = int(input())
	l1 = list(map(int, input().split()))
	l2 = list(map(int, input().split()))
	l1.sort()
	l2.sort()
	v = l1[-1]
	u = l2[-1]
	l1.remove(v)
	l2.remove(u)
	if sum(l1) == sum(l2):
		print('Draw')
	elif sum(l1) > sum(l2):
		print('Bob')
	else:
		print('Alice')


t = int(input())
for i in range(t):
	n = int(input())
	a = [int(j) for j in input().split()]
	b = [int(k) for k in input().split()]
	m = max(a)
	a = sum(a) - m
	z = max(b)
	b = sum(b) - z
	if a < b:
		print('Alice')
	elif a > b:
		print('Bob')
	else:
		print('Draw')


t = int(input())
while t > 0:
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	a.sort()
	a.pop()
	b.sort()
	b.pop()
	al = sum(a)
	bob = sum(b)
	if al < bob:
		print('Alice')
	elif al == bob:
		print('Draw')
	else:
		print('Bob')
	t = t - 1


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	(aTime, bTime) = (sum(a) - max(a), sum(b) - max(b))
	if aTime < bTime:
		print('Alice')
	elif aTime > bTime:
		print('Bob')
	else:
		print('Draw')


for _ in range(int(input())):
	x = int(input())
	list1 = list(map(int, input().split()))
	list2 = list(map(int, input().split()))
	list1 = list(list1)
	list2 = list(list2)
	list1.sort()
	list2.sort()
	k = list(list1[0:len(list1) - 1])
	t = list(list2[0:len(list2) - 1])
	sum1 = sum(k)
	sum2 = sum(t)
	if sum1 < sum2:
		print('Alice')
	elif sum2 == sum1:
		print('Draw')
	else:
		print('Bob')


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))[:n]
	b = list(map(int, input().split()))[:n]
	a[a.index(max(a))] = 0
	b[b.index(max(b))] = 0
	if sum(a) < sum(b):
		print('Alice')
	elif sum(a) > sum(b):
		print('Bob')
	else:
		print('Draw')


for i in range(int(input())):
	n = int(input())
	l1 = list(map(int, input().split()))
	l2 = list(map(int, input().split()))
	a = sum(l1) - max(l1)
	b = sum(l2) - max(l2)
	if a > b:
		print('Bob')
	elif b > a:
		print('Alice')
	else:
		print('Draw')


for i in range(int(input())):
	N = int(input())
	A = list(map(int, input().split(' ')))
	B = list(map(int, input().split(' ')))
	A[A.index(max(A))] = 0
	B[B.index(max(B))] = 0
	if sum(A) < sum(B):
		print('Alice')
	elif sum(A) > sum(B):
		print('Bob')
	else:
		print('Draw')


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	ad = sum(a) - max(a)
	bd = sum(b) - max(b)
	if ad < bd:
		print('Alice')
	elif ad == bd:
		print('Draw')
	else:
		print('Bob')


t = int(input())
while t != 0:
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	alice = sum(a) - max(a)
	bob = sum(b) - max(b)
	if alice < bob:
		print('Alice')
	elif bob < alice:
		print('Bob')
	else:
		print('Draw')
	t -= 1


for i in range(int(input())):
	n = int(input())
	A = list(map(int, input().split()))
	B = list(map(int, input().split()))
	A.remove(max(A))
	B.remove(max(B))
	if sum(A) < sum(B):
		print('Alice')
	elif sum(A) > sum(B):
		print('Bob')
	else:
		print('Draw')


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	arr1 = list(map(int, input().split()))
	a = sum(arr) - max(arr)
	b = sum(arr1) - max(arr1)
	if a > b:
		print('Bob')
	elif a == b:
		print('Draw')
	else:
		print('Alice')


t = int(input())
for i in range(t):
	n = int(input())
	alice = list(map(int, input().split()))
	a = 0
	bob = list(map(int, input().split()))
	b = 0
	for j in range(0, n):
		a = a + alice[j]
		b = b + bob[j]
	a_max = alice[0]
	b_max = bob[0]
	for z in range(0, n):
		if a_max < alice[z]:
			a_max = alice[z]
		if b_max < bob[z]:
			b_max = bob[z]
	a = a - a_max
	b = b - b_max
	if a < b:
		print('Alice')
	elif b < a:
		print('Bob')
	else:
		print('Draw')


for i in range(int(input())):
	N = int(input())
	A = list(map(int, input().split()))
	B = list(map(int, input().split()))
	A.sort()
	B.sort()
	total_alice = 0
	total_bob = 0
	i = 0
	while i < N:
		total_alice = total_alice + A[i]
		total_bob = total_bob + B[i]
		i = i + 1
	a = total_alice - A[N - 1]
	b = total_bob - B[N - 1]
	if a < b:
		print('Alice')
	elif a > b:
		print('Bob')
	else:
		print('Draw')


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()[:n]))
	b = list(map(int, input().split()[:n]))
	sa = sum(a) - max(a)
	sb = sum(b) - max(b)
	if sa < sb:
		print('Alice')
	elif sb < sa:
		print('Bob')
	else:
		print('Draw')


s = int(input())
while s:
	k = int(input())
	l1 = list(map(int, input().split()))
	l2 = list(map(int, input().split()))
	l1.remove(max(l1))
	l2.remove(max(l2))
	o = sum(l1)
	p = sum(l2)
	if o == p:
		print('Draw')
	elif p == min(o, p):
		print('Bob')
	elif o == min(o, p):
		print('Alice')
	s = s - 1


def alice_bob(alice, bob):
	alice.remove(max(alice))
	bob.remove(max(bob))
	result_alice = 0
	result_bob = 0
	result_alice += sum(alice)
	result_bob += sum(bob)
	if result_alice > result_bob:
		return 'Bob'
	elif result_alice < result_bob:
		return 'Alice'
	elif result_bob == result_alice:
		return 'Draw'
T = int(input())
for i in range(T):
	N = int(input())
	alice = list(map(int, input().split()))
	bob = list(map(int, input().split()))
	print(alice_bob(alice, bob))


for i in range(int(input())):
	(sum1, sum2) = (0, 0)
	N = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	a.remove(max(a))
	b.remove(max(b))
	for x in a:
		sum1 += x
	for y in b:
		sum2 += y
	if sum1 < sum2:
		print('Alice')
	elif sum2 < sum1:
		print('Bob')
	else:
		print('Draw')


t = int(input())
for j in range(t):
	n = int(input())
	l1 = list(map(int, input().split()))
	l2 = list(map(int, input().split()))
	a = max(l1)
	b = max(l2)
	l1.remove(a)
	c = sum(l1)
	l2.remove(b)
	d = sum(l2)
	if c < d:
		print('Alice')
	elif d < c:
		print('Bob')
	else:
		print('Draw')