Codeforces Round 294 (Div. 2)
A
A and B and Chess
Codeforces
900
原题
←B →
翻译中…

A and B are preparing themselves for programming contests.

翻译中…

To train their logical thinking and solve problems better, A and B decided to play chess. During the game A wondered whose position is now stronger.

翻译中…

For each chess piece we know its weight:

翻译中…
  • the queen's weight is 9,
  • the rook's weight is 5,
  • the bishop's weight is 3,
  • the knight's weight is 3,
  • the pawn's weight is 1,
  • the king's weight isn't considered in evaluating position.
翻译中…

The player's weight equals to the sum of weights of all his pieces on the board.

翻译中…

As A doesn't like counting, he asked you to help him determine which player has the larger position weight.

翻译中…

Input

翻译中…

The input contains eight lines, eight characters each — the board's description.

翻译中…

The white pieces on the board are marked with uppercase letters, the black pieces are marked with lowercase letters.

翻译中…

The white pieces are denoted as follows: the queen is represented is 'Q', the rook — as 'R', the bishop — as'B', the knight — as 'N', the pawn — as 'P', the king — as 'K'.

翻译中…

The black pieces are denoted as 'q', 'r', 'b', 'n', 'p', 'k', respectively.

翻译中…

An empty square of the board is marked as '.' (a dot).

翻译中…

It is not guaranteed that the given chess position can be achieved in a real game. Specifically, there can be an arbitrary (possibly zero) number pieces of each type, the king may be under attack and so on.

翻译中…

Output

翻译中…

Print "White" (without quotes) if the weight of the position of the white pieces is more than the weight of the position of the black pieces, print "Black" if the weight of the black pieces is more than the weight of the white pieces and print "Draw" if the weights of the white and black pieces are equal.

翻译中…

Note

翻译中…

In the first test sample the weight of the position of the white pieces equals to 9, the weight of the position of the black pieces equals 5.

翻译中…

In the second test sample the weights of the positions of the black and the white pieces are equal to 39.

翻译中…

In the third test sample the weight of the position of the white pieces equals to 9, the weight of the position of the black pieces equals to 16.

翻译中…

样例

Input #1
...QK...
........
........
........
........
........
........
...rk...
Output #1
White
InputCopy OutputCopy
Input #2
rnbqkbnr
pppppppp
........
........
........
........
PPPPPPPP
RNBQKBNR
Output #2
Draw
InputCopy OutputCopy
Input #3
rppppppr
...k....
........
........
........
........
K...Q...
........
Output #3
Black
InputCopy OutputCopy
题目信息
题号
519A
时间限制
1 s
内存限制
256 MB
标签
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。