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;
struct apple {
  int first, second;
  bool operator<(const apple &other) const {
    if (first == other.first) return second < other.second;
    return first < other.first;
  }
} tt, sol[1000011];
struct point {
  int v, nxt;
} edge[1000011 * 3];
map<int, int> hashh;
map<apple, int> fan;
int ans[111], s[101111], n = 4, cnt, dp[1000011], vist[1000011], tot, head,
                         tail, indexx[1000011], tot1;
int que[1000011 * 11], d[1000011];
void change_back(int *a, int temp) {
  for (int i = n; i >= 0; i--) {
    a[i] = temp % 10;
    temp /= 10;
  }
}
int change(int *a) {
  int ret = 0;
  for (int i = 0; i <= n; i++) {
    ret = ret * 10 + a[i];
  }
  return hashh[ret];
}
void find(int dep, int rest) {
  if (dep == 5) {
    int temp = 0;
    for (int i = 0; i <= 4; i++) {
      temp = temp * 10 + ans[i];
    }
    s[++cnt] = temp;
    hashh[temp] = cnt;
    return;
  }
  if (dep == 4) {
    ans[dep] = rest;
    find(dep + 1, 0);
    return;
  }
  for (int i = 0; i <= rest; i++) {
    ans[dep] = i;
    find(dep + 1, rest - i);
  }
}
void addedge(int x, int y) {
  edge[++tot1].v = y;
  edge[tot1].nxt = indexx[x];
  indexx[x] = tot1;
  d[y]++;
}
void put_edge(int nn) {
  int a[11], b[11], x, y, temp, vv;
  memset(a, 0, sizeof(a));
  memset(b, 0, sizeof(b));
  x = sol[nn].first;
  y = sol[nn].second;
  change_back(a, s[x]);
  change_back(b, s[y]);
  if (b[0] == 8) {
    dp[nn] = 2;
    if (vist[nn]) return;
    vist[nn] = 1;
    que[++tail] = nn;
    return;
  }
  for (int i = 1; i <= n; i++) {
    if (!a[i]) continue;
    for (int j = 1; j <= n; j++) {
      if (!b[j]) continue;
      a[(i + j) % 5]++;
      a[i]--;
      temp = change(a);
      tt.first = y;
      tt.second = temp;
      vv = fan[tt];
      addedge(vv, nn);
      a[(i + j) % 5]--;
      a[i]++;
    }
  }
}
void bfs() {
  int t, vv, u;
  while (head < tail) {
    head++;
    u = que[head];
    t = indexx[u];
    while (t) {
      vv = edge[t].v;
      d[vv]--;
      if (!vist[vv]) {
        if (dp[u] == 2) {
          dp[vv] = 1;
          vist[vv] = 1;
          que[++tail] = vv;
        } else if (d[vv] == 0) {
          dp[vv] = 2;
          vist[vv] = 1;
          que[++tail] = vv;
        }
      }
      t = edge[t].nxt;
    }
  }
}
int main() {
  int a[11], b[11], x, y, T, op;
  find(0, 8);
  for (int i = 1; i <= cnt; i++) {
    for (int j = 1; j <= cnt; j++) {
      tt.first = i;
      tt.second = j;
      tot++;
      sol[tot] = tt;
      fan[tt] = tot;
    }
  }
  for (int i = 1; i <= tot; i++) {
    put_edge(i);
  }
  bfs();
  scanf("%d", &T);
  while (T--) {
    memset(a, 0, sizeof(a));
    memset(b, 0, sizeof(b));
    scanf("%d", &op);
    for (int i = 1; i <= 8; i++) {
      scanf("%d", &x);
      a[x]++;
    }
    for (int i = 1; i <= 8; i++) {
      scanf("%d", &x);
      b[x]++;
    }
    x = change(a);
    y = change(b);
    tt.first = x;
    tt.second = y;
    int nn = fan[tt];
    if (op == 0) {
      if (dp[nn] == 0)
        printf("Deal\n");
      else if (dp[nn] == 1)
        printf("Alice\n");
      else if (dp[nn] == 2)
        printf("Bob\n");
    } else {
      tt.first = y;
      tt.second = x;
      nn = fan[tt];
      if (dp[nn] == 0)
        printf("Deal\n");
      else if (dp[nn] == 1)
        printf("Bob\n");
      else if (dp[nn] == 2)
        printf("Alice\n");
    }
  }
  return 0;
}