Chexapawn
Hexapawn is a deterministic, two-player game: and a simpler version of chess. The game is played on an board with rows and
columns.
Each player begins with pawns, one for each square in the row closest to them. The goal is to either advance a pawn to the opposite side of the board, or leave the other player with no legal moves. This can occur either through stalemate or having no pieces to move.
Like in chess, white makes the first move. A pawn can either move one square forward, or capture a pawn diagonally. Unlike chess, the first move of a pawn may not advance it by two spaces.
Here is an example game of Hexapawn where black wins, because white is left with no legal moves.
B B B B B B B . B B . B B . .
. . . -> W . . -> B . . -> W . . -> W . B
W W W . W W . W W . . W . . W
Given an game of Hexapawn, will white or black win, with optimal play?
Chexapawn is just like Hexapawn, but with an extra rule. If one of your pawns can capture, you are forced to capture.
Here is an example game of Chexapawn where white wins, because black is left with no legal moves.
B B B . . B . . B . . . . . .
. W . -> . B . -> . W . -> . B . -> . W .
W . W W . W . . W . . W . . .
Given an game of Chexapawn, will white or black win, with optimal play?
Input
The first line consists of an integer
, the number of columns in the Chexapawn board.
Output
Output the side who is guaranteed to win with optimal play, either "White" or "Black".
Example
Input
3
Output
White
On a board, white can force a win by pushing their middle pawn first (see above).
Input
1
Output
White
On a board, white can only make a single move: the winning move.
Comments