시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB35729424385.866%

문제

We have had a problem with one of our hard disks and we lost the final score of some football matches. However, we have been able to recover the names of the players that scored and found the members of each team on Wikipedia.

입력

The first line will contain three integers A, B and G representing the number of players in team A and team B and the number of goals scored in the match.

The second line will contain A strings separated by spaces. The names of the players of team A.

The third line will contain B strings separated by spaces. The names of the players of team B.

The fourth line will contain G strings. The names of the players that scored.

There will be at most 20 players in each team and at most 100 goals.

The names of the players are lowercase latin letters and they will have at most 20 characters each.

출력

Print "A" if the team A scored more than team B.

Print "B" if the team B scored more than team A.

Print "TIE" if both scored the same number of goals.

예제 입력 1

3 3 5
messi neymar suarez
ronaldo bale james
messi messi messi bale james

예제 출력 1

A

예제 입력 2

4 1 5
jordan pippen oneal bryant
villa
villa villa villa villa villa

예제 출력 2

B

예제 입력 3

3 3 4
messi neymar suarez
ronaldo bale james
bale messi ronaldo suarez

예제 출력 3

TIE