Child's Game with Robot
시간 제한2초메모리 제한1024 MB
3x3 격자에서 로봇을 정확히 열 번 움직여 열 번째 행동에서 숨은 특별 칸에 들어가도록 명령을 설계한다.
문제
This is an interactive problem.
Little Misha plays a child's game with a robot. In this game, the robot stands on a field which is divided into squares and surrounded by borders. The game begins at the center squares and consists in making ten actions. Each action is either declamation of a phrase or an attempt to move into one of the neighboring squares. Declamation is used to wait, or simply for amusement.
One of the squares is special, but Misha does not know in advance which one. The robot reports when it moves into the special square. The goal of the game is to move into the special square precisely during the tenth action.
To communicate with the robot, Misha uses text input and output. The following commands are recognized:
echophrase --- declamation of phrase,move north--- moving one square to the north,move east--- moving one square to the east,move south--- moving one square to the south,move west--- moving one square to the west.
For each declamation command, the robot loudly reads the given phrase, and also prints it back in text. During a declamation, the robot does not move. The robot is guaranteed to correctly handle phrases which consist of characters with ASCII codes from to inclusive and are at most characters long.
For each movement command, the robot prints back one of the four words:
bumpif instead of moving, the robot hit a barrier, in which case, it remains on the same square,movedif the robot successfully moved into a common square,foundif the robot moved into the special square during one of the first nine actions,winif the robot moved into the special square during the tenth action.
Help Misha to play this game in such a way that, during the tenth action, the robot prints the desired word win.
힌트
In each test, the special square is selected in advance and does not change during the contest.