CF811D Vladik and Favorite Game
Description
This is an interactive problem.
Vladik has favorite game, in which he plays all his free time.
Game field could be represented as $ n×m $ matrix which consists of cells of three types:
- «.» — normal cell, player can visit it.
- «F» — finish cell, player has to finish his way there to win. There is exactly one cell of this type.
- «\*» — dangerous cell, if player comes to this cell, he loses.
Initially player is located in the left top cell with coordinates $ (1,1) $ .
Player has access to $ 4 $ buttons "U", "D", "L", "R", each of them move player up, down, left and right directions respectively.
But it’s not that easy! Sometimes friends play game and change functions of buttons. Function of buttons "L" and "R" could have been swapped, also functions of buttons "U" and "D" could have been swapped. Note that functions of buttons can be changed only at the beginning of the game.
Help Vladik win the game!
Input Format
N/A
Output Format
N/A
Explanation/Hint
In first test case all four directions swapped with their opposite directions. Protocol of interaction In more convenient form:

This test could be presenter for hack in following way:
`
4 3 1 1
...
**.
F*.
...
`
4 3 1 1
...
**.
F*.
...
`