Anti-Sorting Game

시간 제한1.5초메모리 제한2048 MB

문제

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.