لینکهای مفید برای شرکت در مسابقه:
در طول مسابقه، میتوانید سؤالات خود را از قسمت «سؤال بپرسید» مطرح کنید.
Who do you like more, Colonel or Morteza? She asks. Colonel. everybody, but Erfan, replies. (yes, even Morteza)
Erfan is still faithful to Morteza so he decides to be absolutely sure about this matter of life or death. He knows that there’s an upcoming tennis match between Colonel and Morteza. He will therefore choose between them based on the result of the match.
Due to the importance of the match, Colonel and Morteza are playing behind closed doors and Erfan is only be able to hear them from behind the walls. The sequence of the sounds that Erfan hears consist of the following:
G
: Ball hits the groundR
: Ball hits a racketN
: Ball hits the net?
: Unknown. can be G
, R
, or N
Erfan has written down the sequence of the sounds that he has heard. He wants to know who wins more games among all possible valid game sequences.
He has seen them play before so he also knows how the game is played. He knows that a valid sequence consists of multiple consecutive valid scores and the player with the most scores wins a sequence. (Morteza wins the sequence in case of a tie in scores) In a valid score:
N
, the ball hits the net and simply falls back in the hitter’s side, causing him to lose a point)Oh and In case of a tie in the number of possible game sequences won, Dog ate… Let’s say Morteza wins again. It is guaranteed that at least one valid sequence exists.
The first line of input contains , the number of test cases.
Each of the following lines contains a single string consisting of G
, R
, N
, and ?
.
For each test case If Morteza is the winner, output Morteza to doost dashtani hasti
. Otherwise output Nasirifar to doost dashtani hasti
.
Here are all the valid sequences for the first test case (scores are separated by space for clarity):
RGRGRGG
RNRGRGG
RGRGRRN
RN RGRRN
RGRGG RN
RN RGG RN
Morteza Wins in of the possible valid sequences, Colonel wins in .