Endgame#3445

Endgame

1 second
64 megabytes
Easy

The chess game was nearing its conclusion, with only two pieces left on the board: the white king and the black king. However, in a twist on traditional chess rules, the players decided to play until the very end, following the motto "Only one should remain!" For security reasons, the kings were replaced by guards.

A guard is a piece that, on each move, moves exactly one square either horizontally or vertically, and can capture a piece on those same squares.

Your task is to determine the outcome of the game, assuming both players play optimally.

Input

The input gives the positions of the guards (first the coordinates of the white guard, then the black guard), followed by who moves first (the symbol B if the black guard moves first, or W if the white guard moves first).

Positions are given in standard chess notation: first, a lowercase Latin letter from a to h (indicating the column), then a digit from 1 to 8 (indicating the row).

Output

Print the outcome of the game assuming both players play optimally:

  • White wins, if the white guard wins;

  • Black wins, if the black guard wins;

  • Draw, if the game ends in a draw.

The game ends in a draw if neither player can win. A player wins when its guard captures the opponent's guard. Initially, the guards can be in any positions on the board, except that they cannot occupy the same square.

Examples

Example 1

Loading
Loading