CODECHEF
There are
players standing in a line, indexed to from left to right. They all play a game of Rock, Paper, Scissors. Each player has already decided which move they want to play. You are given this information as a string of length , i.e,
- is equal to if player will play Rock.
- is equal to if player will play Paper.
- is equal to if player will play Scissors.
Let denote the move played by the winner if players compete in order from left to right. That is,
- First, players and play a game
- The winner of this game plays against player
- The winner of the second game plays against player
- The winner of the first games plays against player , and the move played by the winner of this game is declared to be .
If , then player is considered to be the winner and .
Your task is to find the value of for all from to .
Note : If a person with index and index () play against each other, then:
- If , the winner is decided by classical rules, i.e, rock beats scissors, scissors beats paper, and paper beats rock.
- If , the player with lower index (in this case, ) wins.
Input Format
- The first line of input contains a single integer , denoting the number of test cases. The description of test cases follows.
- The first line of each test case contains a single integer , the number of players.
- The second line of each test case contains the string of length , denoting the moves chosen by the players.
Output Format
For each test case, print a single line containing a string of length , whose -th character is .
Constraints
- is either , or
- Sum of over all test cases doesn't exceed
Subtasks
Subtask 1 (10 points):
- Sum of over all test cases doesn't exceed
Subtask 1 (90 points):
- Original constraints
Sample Input 1
2
1
S
4
SSPR
Sample Output 1
S
RRPR
Explanation
Test Case 1. as there is only one player.
Test Case 2.
For the game is played as follows :
- Player and compete, player wins.
- Player and compete, player wins.
- Player and compete, player wins.
Hence, we print
For the game is played as follows :
- Player and compete, player wins.
Hence, we print
ConversionConversion EmoticonEmoticon