The robots battle in rock-paper-scissors takes place in Innopolis. All advanced robots are engaged in full-fledged work, so the simplest bots participate in the battles. Each of them always play the same shape: a rock, or scissors, or a paper.

The robots stand in a line. Then the judge can choose two neighboring robots, and make them play one round of rock-paper-scissors. If one of them beats the other, the loser is eliminated from the game and is removed from the sequence of robots, the sequence of the remaining ones doesn't change. There are two versions of the rules. In the first of them, if the robots played the same shape, the judge can independently choose which one to remove from the game. In the second version, if the robots played the same shape, both robots remain. The robot wins if all other robots are eliminated from the game.
However, the judge has become very bored with the competition, so he wants to find out for each robot whether the judge can choose pairs in each round so that this robot wins. Help him!
You will need to solve several testcases.
The first line contains an integer t (t≥1) --- the number of tests in the input.
Next, t tests are given, each consisting of an integer and a string.
The integer d denotes the version of the rules that is used in the current robot layout d∈1,2.
Then the string s follows, it contains n (1≤n≤5⋅105) lowercase English letters 'r', 'p' and 's', describing the list of robots. More precisely, the characters 'r', 'p' and 's' denote robots that play rock, paper, and scissors, respectively.
The total sum of n for t given tests does not exceed 5⋅105.
Output t lines: one for each test.
The line should contain n digits '0' and '1', for each i from 1 to n print '1' if the judge can choose such pairs for each round that the i-th robot wins, and '0' otherwise.
First test example: "rpspp", d=1. Let's identify the robots with integers from 1 to 5 from left to right.
In order for the robot 1 to win, the judge can act as follows:
For the robot 2, the judge can't get rid of the 1st robot without removing the 2nd, so the 2nd can't win.
In order for the robot 3 to win, the judge can act as follows:
In order for the robot 4 to win, the judge can act as follows:
In order for the robot 5 to win, the judge can act as follows:
Second test example: "pps", d=2. Let's identify the robots with integers from 1 to 3 from left to right.
For the robot 1 the judge can't get rid of the 2nd robot without removing the 1st, so the 1st can't win.
For the robot 2, the judge can't get rid of the 1st robot without removing the 2nd, so the 2nd can't win.
In order for the robot 3 to win, the judge can act as follows: