Terminator
Two players are engaged in a board game set on an 8×8 square maze. Some cells on the board contain walls. One player controls a terminator piece, while the other controls an escapee piece. Players alternate turns, and skipping a turn is not allowed (a move is always possible). During a turn, a player can move their piece to any adjacent free cell, whether horizontally, vertically, or diagonally, similar to a king's move in chess. Additionally, the terminator has the ability to shoot missiles at the escapee. The missile travels in a straight line in any direction: horizontally, vertically, or diagonally. If the escapee is positioned on the line of fire of the terminator and is not shielded by walls, the terminator will immediately shoot (regardless of whose turn it is), resulting in the escapee's loss. The initial positions of the pieces are provided. The escapee makes the first move. The escapee wins by moving from the eighth row off the board, as the other boundaries are surrounded by walls.
The problem question: Can the escapee win with optimal play from both sides?
Input
The input file describes the game board. A free cell is marked with the digit 0, a cell with a wall is marked with the digit 1, the cell with the escapee is marked with the digit 2, and the cell with the terminator is marked with the digit 3.
Output
Output the number 1 if the escapee can win, and -1 otherwise.