Problem: Imagine that Alice is playing a card game with her friend Bob. They both have exactly 8 cards and there is an integer on each card, ranging from 0 to 4. In each round, Alice or Bob in turns choose two cards from different players, let them be a and b, where a is the number on the player's card, and b is the number on the opponent's card. It is necessary that a ⋅ b ≠ 0. Then they calculate c = (a + b) mod 5 and replace the number a with c. The player who ends up with numbers on all 8 cards being 0, wins.

Now Alice wants to know who wins in some situations. She will give you her cards' numbers, Bob's cards' numbers and the person playing the first round. Your task is to determine who wins if both of them choose the best operation in their rounds.

Input

The first line contains one positive integer T (1 ≤ T ≤ 100 000), denoting the number of situations you need to consider.

The following lines describe those T situations. For each situation:

  * The first line contains a non-negative integer f (0 ≤ f ≤ 1), where f = 0 means that Alice plays first and f = 1 means Bob plays first. 
  * The second line contains 8 non-negative integers a_1, a_2, …, a_8 (0 ≤ a_i ≤ 4), describing Alice's cards. 
  * The third line contains 8 non-negative integers b_1, b_2, …, b_8 (0 ≤ b_i ≤ 4), describing Bob's cards. 



We guarantee that if f=0, we have ∑_{i=1}^{8}a_i ≠ 0. Also when f=1, ∑_{i=1}^{8}b_i ≠ 0 holds.

Output

Output T lines. For each situation, determine who wins. Output 

  * "Alice" (without quotes) if Alice wins. 
  * "Bob" (without quotes) if Bob wins. 
  * "Deal" (without quotes) if it gets into a deal, i.e. no one wins. 

Example

Input

4
1
0 0 0 0 0 0 0 0
1 2 3 4 1 2 3 4
1
0 0 0 1 0 0 0 0
0 0 0 0 4 0 0 0
0
1 0 0 0 0 0 0 0
0 0 0 4 0 0 2 0
1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1


Output

Alice
Bob
Alice
Deal

Note

In the first situation, Alice has all her numbers 0. So she wins immediately.

In the second situation, Bob picks the numbers 4 and 1. Because we have (4 + 1) mod 5 = 0, Bob wins after this operation.

In the third situation, Alice picks the numbers 1 and 4. She wins after this operation.

In the fourth situation, we can prove that it falls into a loop.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void smin(T &a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U>
inline void smax(T &a, U b) {
  if (a < b) a = b;
}
template <class T>
inline void gn(T &first) {
  char c, sg = 0;
  while (c = getchar(), (c > '9' || c < '0') && c != '-')
    ;
  for ((c == '-' ? sg = 1, c = getchar() : 0), first = 0; c >= '0' && c <= '9';
       c = getchar())
    first = (first << 1) + (first << 3) + c - '0';
  if (sg) first = -first;
}
template <class T>
inline void print(T first) {
  if (first < 0) {
    putchar('-');
    return print(-first);
  }
  if (first < 10) {
    putchar('0' + first);
    return;
  }
  print(first / 10);
  putchar(first % 10 + '0');
}
template <class T, class T1>
inline void gn(T &first, T1 &second) {
  gn(first);
  gn(second);
}
template <class T, class T1, class T2>
inline void gn(T &first, T1 &second, T2 &z) {
  gn(first);
  gn(second);
  gn(z);
}
int power(int a, int b, int m, int ans = 1) {
  for (; b; b >>= 1, a = 1LL * a * a % m)
    if (b & 1) ans = 1LL * ans * a % m;
  return ans;
}
inline unsigned int myrand(int n) {
  unsigned int u = rand() % n;
  int c = rand() % 10;
  u ^= u << c;
  u ^= (u << 7) & 263692864;
  u ^= (u << 15) & 402273075;
  u %= n;
  return u;
}
int a[11], b[11];
int alice, bob;
int f, u;
int game[555][555];
int deg[555][555];
int vst[555][555];
int mx[555][555];
int id[100011];
int re[555];
int q[555 * 555 * 4];
int qf, qb;
int nn;
int sum(int u) {
  int ans = 0;
  while (u) {
    ans += u % 10;
    u /= 10;
  }
  return ans;
}
void rget(int val, int *a) {
  val = re[val];
  for (int i = 4; i >= 0; i--) {
    a[i] = val % 10;
    val /= 10;
  }
}
int get(int *a) {
  int now = 0;
  for (int i = 0; i < 5; i++) now = now * 10 + a[i];
  return id[now];
}
void pre() {
  for (int i = 1; i < 100000; i++) {
    if (sum(i) == 8) id[i] = ++nn, re[nn] = i;
  }
  int fir = id[80000];
  for (int i = 1; i <= nn; i++) {
    if (i == fir) continue;
    game[id[80000]][i] = 1, game[i][id[80000]] = 2;
    q[qb++] = fir;
    q[qb++] = i;
    vst[i][fir] = vst[fir][i] = 1;
    q[qb++] = i;
    q[qb++] = fir;
  }
  int aa = 0, bb = 0;
  for (int i = 1; i <= nn; i++) {
    for (int j = 1; j <= nn; j++) {
      rget(i, a);
      rget(j, b);
      aa = 0;
      bb = 0;
      for (int k = 1; k < 5; k++) {
        if (a[k]) aa++;
        if (b[k]) bb++;
      }
      mx[i][j] = aa * bb;
    }
  }
  int al, bo;
  int ta, tb;
  while (qb > qf) {
    al = q[qf++];
    bo = q[qf++];
    rget(al, a);
    rget(bo, b);
    for (int i = 1; i < 5; i++)
      if (a[i]) {
        for (int j = 1, k; j < 5; j++) {
          k = (i + j) % 5;
          if (b[k] == 0) continue;
          b[k]--;
          b[j]++;
          ta = get(b);
          tb = al;
          b[k]++;
          b[j]--;
          if (vst[ta][tb]) continue;
          if (game[al][bo] == 2) {
            game[ta][tb] = 1, q[qb++] = ta, q[qb++] = tb, vst[ta][tb] = 1;
          } else {
            deg[ta][tb]++;
            if (deg[ta][tb] == mx[ta][tb])
              q[qb++] = ta, q[qb++] = tb, game[ta][tb] = 2, vst[ta][tb] = 1;
          }
        }
      }
  }
}
void init() {
  for (int i = 0; i < 5; i++) a[i] = b[i] = 0;
}
void read() {
  gn(f);
  for (int i = 0, u; i < 8; i++) gn(u), a[u]++;
  for (int i = 0, u; i < 8; i++) gn(u), b[u]++;
}
int solve() {
  alice = get(a);
  bob = get(b);
  if (f) {
    if (game[bob][alice] == 0) return 0;
    return 3 - game[bob][alice];
  }
  return game[alice][bob];
}
void ans() {
  int g = solve();
  switch (g) {
    case 0:
      puts("Deal");
      break;
    case 1:
      puts("Alice");
      break;
    case 2:
      puts("Bob");
      break;
  }
}
int main() {
  pre();
  int T;
  cin >> T;
  while (T--) {
    init();
    read();
    ans();
  }
  return 0;
}