Dead Or Not - That Is The Question

On a standard checkerboard ( 8 x 8 squares) the only black piece is the king. The only limitation to the number and kind of white pieces is the number of squares left (63). This means that apart from the black king there can be between zero and 63 white pieces on the board.

Your objective is to determine wheter the black king is under check and cannot move to the square which is not attacked(checkmate) or is not under check but there is no square to go which is not attacked (draw) or there exists a square where it can move (game is not over).

Input and Output

Input consists of several lines. Each line of the input file contains the description of the boards state is a 64-character string with each character representing a square on the board (row after row). The black king will always present in this string. The white king will never be the neighbour of the black king on the board and only one white king will present on the board. The white pawns will never be on positions x1 (x = a, b, c, d, e, f, g, h). The possible values for each character are:

<space> no figure on this square
K black king
p white pawn
r white rook
n white knight
b white bishop
q white queens
k white king

Suppose the chessboard starts at the lower left corner with the field a/1. Therefore white is playing upwards (Starting at a-h/1-8). EOF indicates the end of the input file.

The output consists of : "checkmate" or "draw" or "game is not over" without quotes.

Sample Input

knnnnnnnpppppppppppppppprrrrrrrrrrrrrrrrnnnbqbqbnKnbqbqbnnnbqbqb
nrnrbqnnnpbnbbnqrkbrbprpnrpprqprqpnpnnbprbrqrqnnnnprpppKnqrrbqqq
nrrqbqbrnrpprpbpnbnprqnnnnbrppqqpqpnKqnpnpqrrprrnnbqqnrbqknbqqnn

Sample Output

draw
checkmate
game is not over