Final Score

Given the rosters of two teams and the names of the goal scorers, count each team's goals and decide which team scored more.

Easy1Hash mapImplementationArrayInterviewNo attempts yetTime limit2sMemory limit512 MB

Problem

A hard disk failed and the final scores of several football matches are gone. The names of the players who scored are still on record, and the roster of each team is on Wikipedia. Rebuild the result of one match from that information.

Every player belongs to exactly one of the two teams, so each goal counts for the team of the player who scored it.

Input

The first line contains three integers AA, BB and GG: the number of players on team A, the number of players on team B, and the number of goals scored in the match.

The second line contains the AA names of the players on team A, separated by spaces.

The third line contains the BB names of the players on team B, separated by spaces.

The fourth line contains the GG names of the players who scored, separated by spaces. If GG is 0, this line is empty.

1A201 \le A \le 20, 1B201 \le B \le 20, 0G1000 \le G \le 100. Each name is made of lowercase latin letters and is at most 20 characters long. The A+BA + B names are all different, and every player who scored appears on one of the two rosters.

Output

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

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

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