Bunty and Aunty

0

0 votes
Problem

Bunty is playing chess with his Aunty on a M*N (M is y axis and N is x axis) board but they have just 1 pawn each on cells x1, y1 and x2, y2 respectively. The winner of the game is the one who manages to capture the opponent's piece. Bunty has the black pawn and Aunty has the white pawn.

Determine the winner of the game.

The rules of the game are as follows:

  • Each player alternate turns with White(Aunty) being the one to play first.
  • White Pawn can move from x, y to x, y + 1 if it isnt occupied by the opponent's piece and Black pawn can move from x, y to x, y - 1 similarly.
  • White pawn can capture the black pawn if the white pawn is in x1, y1 and black pawn is either in x1 - 1, y1 + 1 or x1 + 1, y1 + 1 similarly, black pawn can capture the white pawn if the black pawn is in x2, y2 and white pawn is in x2 - 1, y2 - 1 or x2 + 1, y2 - 1.
  • The white pawn can be promoted to either a queen, rook , knight or a bishop when it reaches x, M and similary the black pawn can be promoted when it reaches x, 1 for some x.
  • The queen can move horizontally, vertically and diagonally. The rook can move horizontally and vertically. The bishop moves diagonally and the knight moves from x, y to a square with manhattan distance 3 that isnt on the same x or y line.

Print Bunty, Aunty or Draw.

Draw occurs if no player can move or the game continues for more than 1018 moves. Assume Bunty and Aunty are pro players and both play optimally.

Draw also occurs if both pawns are promoted to another piece and both peices stay in the game for >= 1 move.

Input Format

There are T test cases.

Each test case is a single line consisting of 6 integers N,  M, x1, y1, x2, y2.

Constraints

T=1052N,M10011x1,x2N1y1M1y1<y2M

 

Output Format

Output in a single line for each Test case the winner of the game (Aunty, Bunty or Draw).

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?