ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules

1398. Bishop and Pawn

Time limit: 1.0 second
Memory limit: 64 MB
There are a white bishop and black pawn on a chessboard. Moves are made in accordance with the usual chess rules. White moves first. Black wins if he can promote his pawn to a queen and the white bishop cannot capture the queen by the subsequent move. The game ends in a draw if it’s Black’s turn to move but the pawn cannot move forward. In other cases, White wins. It is required to tell the result of the game if both sides play optimally.

Input

The first and second lines show the positions of the white bishop and black pawn, respectively, by means of the standard chess notation. The rank in which the pawn is initially positioned may have the number from 2 to 7, and the bishop is initially positioned at any square different from the pawn’s square.

Output

Output WHITE if White wins, DRAW in the case of a draw, and BLACK if Black wins.

Sample

inputoutput
a1
c2
WHITE
Problem Author: Magaz Asanov
Problem Source: Practice tour of Urals Championship 2005