Tour Field
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
On an 8×8 chessboard, there is a white king and several black rooks.
Your task is to find a safe move for the king, or determine if the king is in checkmate or stalemate.
Input
The first line provides the position of the white king. The second line gives the number N (0 ≤ N ≤ 63), representing the number of black rooks on the board. The following N lines list the positions of the rooks.
Output
Print Checkmate if the white king is in checkmate, Stalemate if the position is a stalemate, or any safe move for the white king if neither condition applies.
Examples
Input #1
Answer #1
Submissions 117
Acceptance rate 24%