#P1728D. Letter Picking

    ID: 7920 Type: RemoteJudge 2000ms 512MiB Tried: 0 Accepted: 0 Difficulty: 6 Uploaded By: Tags>constructive algorithmsdpgamesgreedytwo pointers*1800

Letter Picking

No submission language available for this problem.

Description

Alice and Bob are playing a game. Initially, they are given a non-empty string ss, consisting of lowercase Latin letters. The length of the string is even. Each player also has a string of their own, initially empty.

Alice starts, then they alternate moves. In one move, a player takes either the first or the last letter of the string ss, removes it from ss and prepends (adds to the beginning) it to their own string.

The game ends when the string ss becomes empty. The winner is the player with a lexicographically smaller string. If the players' strings are equal, then it's a draw.

A string aa is lexicographically smaller than a string bb if there exists such position ii that aj=bja_j = b_j for all j<ij < i and ai<bia_i < b_i.

What is the result of the game if both players play optimally (e. g. both players try to win; if they can't, then try to draw)?

The first line contains a single integer tt (1t10001 \le t \le 1000) — the number of testcases.

Each testcase consists of a single line — a non-empty string ss, consisting of lowercase Latin letters. The length of the string ss is even.

The total length of the strings over all testcases doesn't exceed 20002000.

For each testcase, print the result of the game if both players play optimally. If Alice wins, print "Alice". If Bob wins, print "Bob". If it's a draw, print "Draw".

Input

The first line contains a single integer tt (1t10001 \le t \le 1000) — the number of testcases.

Each testcase consists of a single line — a non-empty string ss, consisting of lowercase Latin letters. The length of the string ss is even.

The total length of the strings over all testcases doesn't exceed 20002000.

Output

For each testcase, print the result of the game if both players play optimally. If Alice wins, print "Alice". If Bob wins, print "Bob". If it's a draw, print "Draw".

Sample Input 1

2
forces
abba

Sample Output 1

Alice
Draw

Note

One of the possible games Alice and Bob can play in the first testcase:

  1. Alice picks the first letter in ss: s=s="orces", a=a="f", b=b="";
  2. Bob picks the last letter in ss: s=s="orce", a=a="f", b=b="s";
  3. Alice picks the last letter in ss: s=s="orc", a=a="ef", b=b="s";
  4. Bob picks the first letter in ss: s=s="rc", a=a="ef", b=b="os";
  5. Alice picks the last letter in ss: s=s="r", a=a="cef", b=b="os";
  6. Bob picks the remaining letter in ss: s=s="", a=a="cef", b=b="ros".

Alice wins because "cef" < "ros". Neither of the players follows any strategy in this particular example game, so it doesn't show that Alice wins if both play optimally.