5406: Vasya和国际象棋

内存限制:256 MB 时间限制:2 S
题面:传统 评测方式:文本比较 上传者:
提交:9 通过:4

题目描述

瓦西娅决定学下棋。经典象棋对他来说似乎没什么意思,所以他自己下象棋。


女王是一件在垂直、水平和对角线上捕捉所有正方形的作品。如果单元格与皇后位于同一垂直、水平或对角线上,并且单元格包含一块敌方颜色,则皇后可以移动到该正方形。之后,敌人的棋子从棋盘上移除。女王不能移动到包含敌人棋子的牢房,如果它和女王之间有其他棋子。

有一个n×n的棋盘。我们将第r行和第c列交叉处的单元格表示为(rc)。正方形(11)包含白色皇后,正方形(1n)包含黑色皇后。所有其他方块都包含不属于任何人的绿色棋子。

球员们轮流移动。首先移动的玩家为白皇后,他的对手为黑皇后。

在每一次移动中,玩家必须与他的皇后一起捕获一些棋子(即,移动到一个包含绿色棋子或敌方皇后的正方形)。如果玩家在移动过程中无法捕捉到任何棋子,或者对手在前一次移动中夺取了他的皇后,则玩家将输掉比赛。

帮助Vasya确定如果两名球员都在棋盘上采用最佳策略n×n,谁会获胜。

Vasya decided to learn to play chess. Classic chess doesn't seem interesting to him, so he plays his own sort of chess.
The queen is the piece that captures all squares on its vertical, horizontal and diagonal lines. If the cell is located on the same vertical, horizontal or diagonal line with queen, and the cell contains a piece of the enemy color, the queen is able to move to this square. After that the enemy's piece is removed from the board. The queen cannot move to a cell containing an enemy piece if there is some other piece between it and the queen.
There is an n×n chessboard. We'll denote a cell on the intersection of the r-th row and c-th column as (r,c). The square (1,1) contains the white queen and the square (1,n) contains the black queen. All other squares contain green pawns that don't belong to anyone.
The players move in turns. The player that moves first plays for the white queen, his opponent plays for the black queen.
On each move the player has to capture some piece with his queen (that is, move to a square that contains either a green pawn or the enemy queen). The player loses if either he cannot capture any piece during his move or the opponent took his queen during the previous move.
Help Vasya determine who wins if both players play with an optimal strategy on the board n×n.
Input
The input contains a single number n (2≤n≤109) − the size of the board.
Output
On the first line print the answer to problem − string "white" or string "black", depending on who wins if the both players play optimally.
If the answer is "white", then you should also print two integers r and c representing the cell (r,c), where the first player should make his first move to win. If there are multiple such cells, print the one with the minimum r. If there are still multiple squares, print the one with the minimum c.
Examples
Input
2
Output
white
1 2
Input
3
Output
black
Note
In the first sample test the white queen can capture the black queen at the first move, so the white player wins.
In the second test from the statement if the white queen captures the green pawn located on the central vertical line, then it will be captured by the black queen during the next move. So the only move for the white player is to capture the green pawn located at (2,1).
Similarly, the black queen doesn't have any other options but to capture the green pawn located at (2,3), otherwise if it goes to the middle vertical line, it will be captured by the white queen.
During the next move the same thing happens − neither the white, nor the black queen has other options rather than to capture green pawns situated above them. Thus, the white queen ends up on square (3,1), and the black queen ends up on square (3,3).
In this situation the white queen has to capture any of the green pawns located on the middle vertical line, after that it will be captured by the black queen. Thus, the player who plays for the black queen wins.

输入格式

输入包含单个数字n2≤n≤109),即棋盘的大小。

输出格式

在第一行打印问题的答案——字符串“white”或字符串“black”,这取决于如果两名球员都发挥最佳,谁获胜。

如果答案是“white”,那么您还应该打印两个整数rc,表示单元格(rc),第一个玩家应该在其中第一步获胜。如果有多个这样的单元格,则打印最小r的单元格。如果仍有多个正方形,则打印最大c的单元格。



Examples
Input
2
Output
white
1 2
Input
3
Output
black


注意

在第一个样本测试中,白皇后可以在第一步就抓住黑皇后,因此白色玩家获胜。

在声明的第二个测试中,如果白皇后抓住了位于中心垂直线上的绿色棋子,那么在下一步中,它将被黑皇后抓住。因此,白色玩家唯一的行动是抓住位于(2,1)的绿色棋子。

同样,黑皇后除了抓住位于(23)的绿色棋子外没有其他选择,否则如果它走到中间的垂直线,它将被白皇后抓住。

在下一步行动中,同样的事情发生了——白皇后和黑皇后都没有其他选择,而不是抓住他们上方的绿色棋子。因此,白皇后以正方形(31)结尾,黑皇后以方形(33)结尾。

在这种情况下,白皇后必须捕获位于中间垂直线上的任何一个绿色棋子,之后它将被黑皇后捕获。因此,为黑皇后效力的玩家获胜。

输入样例 复制

2

输出样例 复制

white
1 2