# DICENUM - Editorial

Author: notsoloud
Tester: raysh07
Editorialist: iceknight1093

TBD

None

# PROBLEM:

Alice and Bob roll three dice. The score of a player is the maximum number that can be formed from the digits they have.
Find the person with higher score.

# EXPLANATION:

The largest number Alice can form is by placing \max(A_1, A_2, A_3) first; then the maximum of the remaining two digits next; and finally the last one.
This can also be seen as sorting the array [A_1, A_2, A_3] in descending order.

Bobâ€™s largest number is similarly obtained by sorting [B_1, B_2, B_3] in descending order.

Once both playersâ€™ scores are known, compare them to see who wins, for example by using if conditions.

# TIME COMPLEXITY

\mathcal{O}(1) per testcase.

# CODE:

Editorialist's code (Python)
for _ in range(int(input())):
a, b, c, d, e, f = map(int, input().split())
alice, bob = sorted([a, b, c]), sorted([d, e, f])
ans = 'Tie'
for i in reversed(range(3)):
if alice[i] == bob[i]: continue
if alice[i] < bob[i]: ans = 'Bob'
else: ans = 'Alice'
break
print(ans)