Throwing dice
Alice and Bob are discussing penalty shoot-outs and their randomness: "We might as well be throwing dice to determine the winner!", Alice said. And so they started simulating penalty shoot-outs by each throwing dice, summing the points indicated on their dice, and comparing these sums. The player with the largest sum wins; in case both sums are equal, there is a tie.
But even in such situations, some player might have an edge over their opponent, depending on which dice they throw. Thus, just by looking at the dice they are about to throw, Alice and Bob want to determine who has the better edge.
Alice has fair dice, with sides. For all integers and such that and , the -th die of Alice has a probability of showing its face numbered . Then, Alice's score is the sum of the numbers displayed by her dice. Similarly, Bob has fair dice, with sides.
Given these dice, Alice has a probability of having a strictly larger score than Bob, and Bob has a probability of having a strictly larger score than Alice. Which probability is the largest one?
Giriş verilənləri
The first line contains the numbers and . The second line contains the numbers . The third line contains the numbers .
Çıxış verilənləri
Print a single uppercase word: "ALICE" if , "TIED" if , and "BOB" if .