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;
int f[1000010], b[1000010], map1[1000010], fmap[1000010], v2[1000010],
    a[1000010], c[1010][1010], u[1010][1010], v[1010][1010], v1[1010][1010],
    h1[1000010], g1[1000010], g2[1000010], tot;
struct node {
  int x, y, z;
} q[1000010];
int js(int *a) {
  int i;
  for (i = 0; i <= 4; i++) v2[i] = 0;
  for (i = 1; i <= 8; i++) v2[a[i]]++;
  int sum = 0;
  for (i = 0; i <= 4; i++) sum = sum * 10 + v2[i];
  return sum;
}
void fjs(int *a, int sum) {
  int g1 = fmap[sum], i;
  for (i = 4; i >= 0; i--) {
    v2[i] = g1 % 10;
    g1 /= 10;
  }
  int top = 0;
  for (i = 1; i <= 8; i++) {
    while (!v2[top]) top++;
    a[i] = top;
    v2[top]--;
  }
}
void dfs(int x, int y) {
  int i;
  if (x == 9) {
    int sum = js(f);
    map1[sum] = ++tot;
    fmap[tot] = sum;
    return;
  }
  for (i = y; i <= 4; i++) {
    f[x] = i;
    dfs(x + 1, i);
  }
}
void bfs(int x) {
  int r = 0, l = x, i, j, k;
  while (r < l) {
    node xx = q[r];
    r++;
    fjs(g1, xx.x);
    fjs(g2, xx.y);
    for (i = 1; i <= 8; i++) {
      int x = g2[i];
      int g = fmap[xx.y] - h1[g2[i]];
      for (j = 1; j <= 8; j++) {
        int y = g1[j];
        if (y != 0 && y != x) {
          g2[i] = (g2[i] + 5 - g1[j]) % 5;
          int u1 = map1[g + h1[g2[i]]];
          u[u1][xx.x]--;
          if (v1[u1][xx.x])
            c[u1][xx.x] = max(c[u1][xx.x], -xx.z);
          else {
            c[u1][xx.x] = -xx.z;
            v1[u1][xx.x] = 1;
          }
          if (!v[u1][xx.x] && (u[u1][xx.x] == 0 || xx.z == -1)) {
            v[u1][xx.x] = 1;
            q[l].x = u1;
            q[l].y = xx.x;
            q[l].z = c[u1][xx.x];
            l++;
          }
          g2[i] = x;
        }
      }
    }
  }
}
int main() {
  int i, j, k, flag, t, a1, b1;
  scanf("%d", &t);
  dfs(1, 0);
  h1[4] = 1;
  for (i = 3; i >= 0; i--) h1[i] = h1[i + 1] * 10;
  for (i = 1; i <= 8; i++) a[i] = 0;
  int h = map1[js(a)];
  for (i = 1; i <= tot; i++)
    for (j = 1; j <= tot; j++) {
      fjs(g1, i);
      fjs(g2, j);
      for (a1 = 1; a1 <= 8; a1++) {
        if (g1[a1] != 0) {
          for (b1 = 1; b1 <= 8; b1++)
            if (g1[a1] != g2[b1]) {
              int h10 =
                  map1[fmap[j] - h1[g2[b1]] + h1[(g2[b1] - g1[a1] + 5) % 5]];
              u[h10][i]++;
            }
        }
      }
    }
  int l = 0;
  for (i = 1; i <= tot; i++) {
    if (i != h) {
      q[l].x = h;
      q[l].y = i;
      q[l].z = 1;
      l++;
      q[l].x = i;
      q[l].y = h;
      q[l].z = -1;
      l++;
      c[h][i] = 1;
      c[i][h] = -1;
      v[i][h] = 1;
      v[h][i] = 1;
    }
  }
  bfs(l);
  while (t--) {
    scanf("%d", &flag);
    for (i = 1; i <= 8; i++) scanf("%d", &a[i]);
    for (i = 1; i <= 8; i++) scanf("%d", &b[i]);
    int sum1 = map1[js(a)];
    int sum2 = map1[js(b)];
    if (flag == 1) swap(sum1, sum2);
    if (c[sum1][sum2] == 0 || v[sum1][sum2] == 0) {
      printf("Deal\n");
      continue;
    } else if ((c[sum1][sum2] == -1 && flag == 1) ||
               (c[sum1][sum2] == 1 && flag == 0))
      printf("Alice\n");
    else
      printf("Bob\n");
  }
}