| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1.5 초 | 2048 MB | 4 | 3 | 3 | 75.000% |
This is an interactive problem.
Busy Beaver and Lazy Lemur are playing a game on a binary string $s$ that is initially not sorted. In this game, they take turns choosing some subsequence1 that isn't sorted, and sort it in place. Formally, they select indices $b_1 < b_2 < \dots < b_k$ such that the string $s_{b_1}s_{b_2}\dots s_{b_k}$ is not sorted, and sort only these characters of the original string.
It can be shown that no matter how the two players move, the string will become sorted after a finite number of turns. When this happens, the player who made the final move loses, and the other player wins.
Busy Beaver needs your help to beat Lazy Lemur. Given the starting string, determine whether or not Busy Beaver should choose to go first or second, then make a series of moves that wins against the judge.
1A sequence $a$ is a subsequence of a sequence $b$ if $a$ can be obtained from $b$ by the deletion of several (possibly, zero or all) elements.
Each test contains multiple test cases. The first line of input contains a single integer $T$ $(1 \leq T \leq 100)$, the number of test cases. The description of each test case follows.
The first line of each test case contains the string $s$ ($2 \leq |s| \leq 400$), consisting of characters '0' and/or '1'. It is guaranteed that the sum of $|s|$ over all test cases does not exceed $400$.
Afterwards, output a string that is either First or Second (case-insensitive), representing whether you wish to move first or second, respectively.
Then, your program will play against the judge.
Once the string becomes sorted, one of two events will happen:
Each time your program makes a move, do not forget to output the end of line and flush the output. Otherwise, you will get an Idleness limit exceeded verdict. To do this, use:
fflush(stdout) or cout.flush() in C++;System.out.flush() in Java;stdout.flush() in Python.If, at any interaction step, you read $-1$ instead of valid data, your solution must exit immediately. This means that your solution will receive a Wrong answer verdict because of an invalid query or any other mistake. Failing to exit can result in an arbitrary verdict because your solution will continue to read from a closed stream.
3 100 001 0101 0011 1100 0110 0011
First 2 1 2 Second First 2 2 3 3 1 3 4