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.


-----Examples-----
Input
...QK...
........
........
........
........
........
........
...rk...

Output
White

Input
rnbqkbnr
pppppppp
........
........
........
........
PPPPPPPP
RNBQKBNR

Output
Draw

Input
rppppppr
...k....
........
........
........
........
K...Q...
........

Output
Black



-----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.

Difficulty: interview

Starter code:

Solutions:
a = 0
b = 0
x = {'Q': 9, 'q':9, 'R':5, 'r':5, 'B':3, 'b':3, 'N':3, 'n':3, 'P': 1, 'p': 1}
for i in range(8):
    t = [i for i in input()]
    for i in t:
        if ord(i) >= 97 and i in x:
            a += x[i]
        elif i in x:
            b += x[i]
if a == b:
    print("Draw")
elif a < b:
    print("White")
else:
    print("Black")

A = [''] * 8
b = 0
w = 0
def count(v):
    nonlocal w, b
    if v == 'Q':
        w += 9
    elif v == 'R':
        w += 5
    elif v == 'B':
        w += 3
    elif v == 'N':
        w += 3
    elif v == 'P':
        w += 1
    elif v == 'q':
        b += 9
    elif v == 'r':
        b += 5
    elif v == 'b':
        b += 3
    elif v == 'n':
        b += 3
    elif v == 'p':
        b += 1
for i in range(8):
    A[i] = input()
    for j in range(8):
        count(A[i][j])
if b > w:
    print("Black")
elif b == w:
    print("Draw")
else:
    print("White")


board = list(input()+input()+input()+input()+input()+input()+input()+input())
w = 0
b = 0
w += 9*board.count('Q')
w += 5*board.count('R')
w += 3*board.count('N')
w += 3*board.count('B')
w += board.count('P')

b += 9*board.count('q')
b += 5*board.count('r')
b += 3*board.count('n')
b += 3*board.count('b')
b += board.count('p')

if w > b:
    print("White")

elif w == b:
    print("Draw")

else:
    print("Black")


S = dict()
S['Q'] = 9
S['R'] = 5
S['B'] = 3
S['N'] = 3
S['P'] = 1
S['K'] = 0
S['q'] = -9
S['r'] = -5
S['b'] = -3
S['n'] = -3
S['p'] = -1
S['k'] = 0

score = 0
for i in range(8) :
    x = input()
    for j in x :
        if j in S :
            score += S[j]

if score > 0 :
    print("White")
elif score == 0 :
    print("Draw")
else :
    print("Black")


w = 0
b = 0
for i in range(8):
    st = input()
    for j in st:
        if j == 'Q':
            w+=9
        if j == 'R':
            w+=5    
        if j == 'B':
            w+=3                
        if j == 'N':
            w+=3                    
        if j == 'P':
            w+=1      
        if j == 'q':
            b+=9
        if j == 'r':
            b+=5    
        if j == 'b':
            b+=3                
        if j == 'n':
            b+=3                    
        if j == 'p':
            b+=1      
if w > b:
    print('White')
elif w < b:
    print('Black')
else:
    print('Draw')


desc = []
for i in range (8):
    input_str = input()
    desc.append(input_str)
w, b = 0, 0
""" вес ферзя равен 9,
вес ладьи равен 5,
вес слона равен 3,
вес коня равен 3,
вес пешки равен 1, """
for i in range (8):
    for j in range(8):
        if desc[i][j]=='Q':
            w += 9
        elif desc[i][j]=='q':
            b += 9
        elif desc[i][j]=='R':
            w += 5
        elif desc[i][j]=='r':
            b += 5
        elif desc[i][j]=='B':
            w += 3
        elif desc[i][j]=='b':
            b += 3
        elif desc[i][j]=='N':
            w += 3
        elif desc[i][j]=='n':
            b += 3
        elif desc[i][j]=='P':
            w += 1
        elif desc[i][j]=='p':
            b += 1
        else:
            pass
if w>b:
    print ("White")
elif b>w:
    print ("Black")
else:
    print ("Draw")
#ферзь обозначается символом 'Q', ладья — 'R', слон — 'B', конь — 'N', пешка — 'P', король — 'K'.


desk = [list(input()) for i in range(8)]
C = {'q' : 9, 'r' : 5, 'b' : 3, 'n' : 3, 'p' : 1, 'k' : 0, '.' : 0}
p1 = 0
p2 = 0
for x in desk:
    for x2 in x:
        if x2.isupper():
            p2 += C[x2.lower()]
        else:
            p1 += C[x2]
if p1 == p2:
    print('Draw')
else:
    print('White' if p2 > p1 else 'Black')
    


figures = {'q': 9, 'r': 5, 'b': 3, 'n': 3, 'p': 1, 'k': 0}

black_w, white_w = 0, 0
for _ in range(0, 8):
    row = input().strip()
    for c in row:
        if c.lower() in figures:
            if c.lower() == c:
                black_w += figures[c]
            else:
                white_w += figures[c.lower()]

if black_w == white_w:
    print('Draw')
elif black_w > white_w:
    print('Black')
else:
    print('White')

p = {'K': 0, 'Q': 9, 'R': 5, 'B': 3, 'N': 3, 'P': 1, '.': 0}
w = [0, 0]
for r in range(8):
    for ch in input():
        if ch != '.':
            w[ch.islower()] += p[ch.upper()]
if w[0] == w[1]:
    print('Draw')
else:
    print('White' if w[0] > w[1] else 'Black')


import sys
read = lambda t=int: list(map(t,sys.stdin.readline().split()))
array = lambda *ds: [array(*ds[1:]) for _ in range(ds[0])] if ds else 0

val = {'q':9,'r':5,'b':3,'n':3,'p':1}
s = ''.join(sys.stdin.readline() for _ in range(8))
res = 0
for c in s:
    if c.islower():
        res += val.get(c, 0)
    else:
        res -= val.get(c.lower(), 0)

if res == 0:
    print("Draw")
if res < 0:
    print("White")
if res > 0:
    print("Black")


def main():
    bw = [0, 0]
    for _ in range(8):
        for c in input():
            if c.isalpha():
                bw[c.isupper()] += {'Q': 9, 'R': 5, 'B': 3, 'N': 3, 'P': 1, 'K': 0}[c.upper()]
    if bw[0] < bw[1]:
        print("White")
    elif bw[0] > bw[1]:
        print("Black")
    else:
        print("Draw")


def __starting_point():
    main()
__starting_point()

i=0
l=''
while i<8:
    l+=input()
    i+=1
w=l.count('Q')*9+l.count('R')*5+l.count('B')*3+l.count('N')*3+l.count('P')
b=l.count('q')*9+l.count('r')*5+l.count('b')*3+l.count('n')*3+l.count('p')
if w>b:
    print('White')
elif b>w:
    print('Black')
else:
    print('Draw')
        


m = []

f = {
    '.': 0,
    'q': -9,
    'r': -5,
    'b': -3,
    'n': -3,
    'p': -1,
    'k': 0,
    'Q': 9,
    'R': 5,
    'B': 3,
    'N': 3,
    'P': 1,
    'K': 0,
}

for i in range(8):
    m.append(list(input()))

cnt = 0

for s in m:
    for c in s:
        if c in f:
            cnt += f[c]


if cnt > 0:
    print('White')
elif cnt < 0:
    print('Black')
else:
    print('Draw')

import sys
# sys.stdin = open('in.txt')
R = lambda: map(int, input().split())

score={'q':9, 'r':5, 'b':3, 'n':3, 'p':1, 'k':0,
       'Q':-9,'R':-5,'B':-3,'N':-3,'P':-1,'K':0, '.':0}

sum=0
for _ in range(8):
    for c in input():
        sum+=score[c]

if sum==0:
    print("Draw")
elif sum>0:
    print("Black")
else:
    print("White")

r = dict()
sb = 0
sw = 0
r['Q'] = r['q'] = 9
r['B'] = r['b'] = 3
r['K'] = r['k'] = 0
r['N'] = r['n'] = 3
r['p'] = r['P'] = 1
r['R'] = r['r'] = 5

s1 = 'prqkbn'
s2 = s1.upper()

for i in range(8):
    t = input()
    for k in t:
        if k in s1:
            sb += r[k]
        else:
            if k in s2:
                sw += r[k]
if sw == sb:
    print('Draw')
elif sw > sb:
    print('White')
else:
    print('Black')


import sys
w=0
b=0
for i in range(8):
  n=list(sys.stdin.readline())
  for j in n:
    if j=='q':
      w=w+9
    if j=='Q':
      b=b+9
    if j=='r':
      w=w+5
    if j=='R':
      b=b+5
    if j=='b':
      w=w+3
    if j=='B':
      b=b+3
    if j=='n':
      w=w+3
    if j=='N':
      b=b+3
    if j=='p':
      w=w+1
    if j=='P':
      b=b+1	  
if w<b:  print("White")
elif w>b:  print("Black")
else:  print("Draw")

w = 0
b = 0
for j in range(8):
    c = input()
    for i in range(8):
        if c[i] == 'Q':
            w += 9
        if c[i] == 'R':
            w += 5
        if c[i] == 'B' or c[i] == 'N':
            w += 3
        if c[i] == 'P':
            w += 1
        if c[i] == 'q':
            b += 9
        if c[i] == 'r':
            b += 5
        if c[i] == 'b' or c[i] == 'n':
            b += 3
        if c[i] == 'p':
            b += 1
if w > b:
    print('White')
elif b != w:
    print('Black')
else:
    print('Draw')


def black(a):
    m = 0
    for i in a:
        i = list(i)
        for ii in i:
            if ii == "r":
                m += 5
            if ii == "q":
                m += 9
            if ii == "b":
                m += 3
            if ii == "n":
                m += 3
            if ii == "p":
                m += 1
            if ii == "k":
                m += 0
    return m
def white(a):
    m = 0
    for i in a:
        i = list(i)
        for ii in i:
            if ii == "R":
                m += 5
            if ii == "Q":
                m += 9
            if ii == "B":
                m += 3
            if ii == "N":
                m += 3
            if ii == "P":
                m += 1
            if ii == "K":
                m += 0
    return m

b = []
i = 0
while i<8:
    a = input()
    b.append(a)
    i+=1
if white(b)>black(b):
    print("White")
if black(b)>white(b):
    print("Black")
if black(b)==white(b):
    print("Draw")


ws = dict(list(zip("qrbnp", (9, 5, 3, 3, 1))))
white = black = 0
for ch in [ch for ch in str.join("", [input() for _ in range(8)]) if ch.lower() not in ".k"]:

    if str.isupper(ch):

        white += ws[ch.lower()]

    else:

        black += ws[ch]

if black > white:

    print("Black")

elif black < white:

    print("White")

else:

    print("Draw")


s = [""] * 8
for i in range(0,8):
	s[i] = input()
white = {}
black = {}
white['Q'] = 9
white['R'] = 5
white['B'] = 3
white['N'] = 3
white['P'] = 1
white['q'] = 0
white['r'] = 0
white['b'] = 0
white['n'] = 0
white['p'] = 0
white['.'] = 0
white['K'] = 0
white['k'] = 0
black['Q'] = 0
black['R'] = 0
black['B'] = 0
black['N'] = 0
black['P'] = 0
black['q'] = 9
black['r'] = 5
black['b'] = 3
black['n'] = 3
black['p'] = 1
black['.'] = 0
black['K'] = 0
black['k'] = 0
w = 0
b = 0
for i in range(0,8):
	for j in range(0,8):
		w = w+white[s[i][j]]
		b = b+black[s[i][j]]
if w>b:
	print("White")
elif w<b:
	print("Black")
else:
	print("Draw")

# sorry for the source code iam a newbie in Python
chess = []
for i in range(8):
    chess.append(input())
s = 'qrbnpk'
w = [9,5,3,3,1,0]
D = dict(list(zip(s,w)))
D1 = dict(list(zip(s.upper(),w)))
dic = dict.fromkeys(s,0)
dic2 = dict.fromkeys(s.upper(),1)
dic2.update(dic)
res = [0,0]
for i in range(8):
    for j in range(8):
        if chess[i][j] != '.':
            res[dic2[chess[i][j]]] += D[chess[i][j].lower()]
first = res[0]
sec = res[1]
if first > sec:
    print ('Black')
elif first == sec:
    print ('Draw')
else:
    print ('White')


__author__ = 'Krishna'

values = {'q': 9, 'r': 5, 'b': 3, 'n': 3, 'p': 1, 'k': 0}
whiteStrength = 0
blackStrength = 0
for i in range(8):
    for piece in input():
        if ord('a') <= ord(piece) <= ord('z'):
            blackStrength += values.get(piece)
        elif ord('A') <= ord(piece) <= ord('Z'):
            whiteStrength += values.get(piece.lower())
if whiteStrength > blackStrength:
    print("White")
elif whiteStrength == blackStrength:
    print("Draw")
else:
    print("Black")


u = 0
v = 0
def f(c):
    nonlocal u
    nonlocal v
    if c == 'Q':
        u += 9
    elif c == 'R':
        u += 5
    elif c == 'B':
        u += 3
    elif c == 'N':
        u += 3
    elif c == 'P':
        u += 1
    elif c == 'q':
        v += 9
    elif c == 'r':
        v += 5
    elif c == 'b':
        v += 3
    elif c == 'n':
        v += 3
    elif c == 'p':
        v += 1

for i in range(8):
    for c in input():
        f(c)

if u == v:
    print('Draw')
elif u > v:
    print('White')
else:
    print('Black')




import string

wp, bp = 0, 0
for i in range(8):
    inStr = input()
    for p in list(inStr):
        if not p=='.':
            lp = p.lower()
            points = {'q':9, 'r':5, 'b':3, 'n':3, 'p':1, 'k':0}[lp]
            if not p.islower():
                wp = wp + points
            else:
                bp = bp + points

wp > bp and print('White') or wp == bp and print('Draw') or wp < bp and print('Black')

white = { 'Q' : 9, 'R' : 5, 'B' : 3, 'N' : 3, 'P' : 1 , 'K' : 0 }
black = { 'q' : 9, 'r' : 5, 'b' : 3, 'n' : 3, 'p' : 1 , 'k' : 0 }

import string

white_w = 0
black_w = 0

for i in range(8):
    line = input()
    for c in line:
        if c != '.':
            if c in string.ascii_uppercase:
                white_w += white[c]
            else:
                black_w += black[c]

if white_w > black_w:
    print("White",end="")
elif white_w < black_w:
    print("Black",end="")
else:
    print("Draw",end="")