Rock Paper Scissors?

Time limit1sMemory limit128 MB

Problem

Rock paper scissors is a game played by two people. They usually play a predetermined number of rounds, and whoever wins more rounds becomes the final winner.

Given the number of rounds played and what each of the two players threw in every round, write a program that prints the final winner.

  • Rock beats scissors.
  • Scissors beats paper.
  • Paper beats rock.

Input

The first line contains the number of test cases $t$ ($0 < t < 1000$).

The first line of each test case contains the number of rounds $n$ ($0 < n < 100$). Each of the following $n$ lines contains two characters separated by a space. Each character is one of R, P, S, denoting rock, paper, and scissors respectively. The first character is Player 1's throw and the second is Player 2's throw.

Output

For each test case, print the winner on its own line. Print Player 1 if Player 1 wins more rounds, Player 2 if Player 2 wins more rounds, and TIE if both players win the same number of rounds.