URI Online Judge | 1419

Bakugan

By Ines Kereki Uruguay
Timelimit: 1

Mark and Leti love to play with Bakugan balls. These balls are small plastic spheres with a tiny monster toy inside. When dropped to the ground, a Bakugan ball pops open with an incredible sound, liberating a fearsome Bakugan monster. Mark and Leti love to play with the toy monsters, but popping open the balls is also great fun.

Each of them received a bag with Bakugan balls, and they invented a game to pop open the balls. There are 10 different monsters, and for the game Mark and Leti associated each monster with a different integer from 1 to 10, according to the monster’s ugliness. The game is composed of R rounds. At each round:

The winner of the game is the player who accumulates more points. Please help Mark and Leti announce the winner of the game!

Input

Each test case is described using three lines. The first line contains an integer R representing the number of rounds of the game (1 ≤ R ≤ 10). The second line contains R integers Mi indicating the monsters liberated by Mark at each turn (1 ≤ Mi ≤ 10 for 1 ≤ iR). The third line contains R integers Li indicating the monsters liberated by Leti at each turn (1 ≤ Li ≤ 10, for 1 ≤ iR).

The last test case is followed by a line containing one zero.

Output

For each test case output a line with a character representing the result of the game: "M" (uppercase) if the winner is Mark, "L" (uppercase) if the winner is Leti, or "T" (uppercase) if there is a tie.

Sample Input Sample Output

10
4 2 2 2 5 6 7 8 1 1
1 4 4 4 1 1 1 1 2 3
5
3 3 3 3 2
8 9 9 9 9
10
8 4 7 1 1 9 5 2 4 3
5 6 9 7 9 4 2 3 7 4
0

M
T
L