Two players play a board game. The game field is a square maze of 8 \times 8 cells. Some cells contain walls. One player controls the Terminator piece, and the other controls the Fugitive piece. Players take turns; skipping a turn is not allowed (it is guaranteed that a move is always possible). In one move, a player can move their piece to any of the adjacent free cells horizontally, vertically, or diagonally (that is, as a king moves in chess). The Terminator, in addition, can shoot at the Fugitive with rockets. The shot travels in a straight line in any direction horizontally, vertically, or diagonally. If the Fugitive is in the line of fire of the Terminator and is not blocked by walls, the Terminator immediately shoots (regardless of whose turn it is), and the Fugitive loses. The initial positions of the pieces are given. The Fugitive makes the first move. The Fugitive wins if they move from the eighth row to outside the field, as the other sides of the field are bounded by walls.
The question: Can the Fugitive win if both sides play optimally?
The input file contains the game field. A free cell is represented by the number , a cell with a wall by the number . The Fugitive's cell is denoted by the number , and the Terminator's cell by the number .
Output the number if the Fugitive wins, and otherwise.
Example 1