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 <typename 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, 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);
}
template <typename 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 <typename T>
inline void println(T first) {
  print(first), putchar('\n');
}
template <typename T>
inline void printsp(T first) {
  print(first), putchar(' ');
}
template <class T, class T1>
inline void print(T first, T1 second) {
  printsp(first), println(second);
}
template <class T, class T1, class T2>
inline void print(T first, T1 second, T2 z) {
  printsp(first), printsp(second), println(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;
}
int n;
int id[111111];
int st[500];
void calc(int k, int s, int val) {
  if (k == 5) {
    if (s == 8) id[val] = n, st[n] = val, n++;
    return;
  }
  for (int i = 0; s + i <= 8; i++) calc(k + 1, s + i, val * 10 + i);
}
int val[500][500], sz[500][500], now[500][500];
vector<pair<int, int> > rev[500][500];
int get(int *d) {
  int ans = 0;
  for (int i = 5; i--;) ans = ans * 10 + d[i];
  return ans;
}
queue<pair<int, int> > q;
void pre() {
  int d1[5], d2[5];
  for (int i = 0; i < n; i++) {
    for (int m = st[i], k = 0; k < 5; k++, m /= 10) d1[k] = m % 10;
    for (int j = 0; j < n; j++) {
      for (int m = st[j], k = 0; k < 5; k++, m /= 10) d2[k] = m % 10;
      for (int a = 0; a < 4; a++) {
        if (!d1[a + 1]) continue;
        for (int b = 0; b < 4; b++) {
          if (!d2[b + 1]) continue;
          int c = (a + 1 + b + 1) % 5;
          d1[a + 1]--;
          d1[c]++;
          sz[i][j]++;
          rev[j][id[get(d1)]].push_back(pair<int, int>(i, j));
          d1[a + 1]++;
          d1[c]--;
        }
      }
    }
  }
  memset(val, -1, sizeof(val));
  int winst = 8;
  int winid = id[winst];
  for (int i = 0; i < n; i++) {
    if (i == winid) continue;
    val[i][winid] = 0, val[winid][i] = 1;
    q.push(pair<int, int>(i, winid));
    q.push(pair<int, int>(winid, i));
  }
  while (!q.empty()) {
    pair<int, int> p = q.front();
    q.pop();
    if (val[p.first][p.second] == 0) {
      for (int i = 0; i < rev[p.first][p.second].size(); i++) {
        pair<int, int> to = rev[p.first][p.second][i];
        if (val[to.first][to.second] == -1) {
          val[to.first][to.second] = 1;
          q.push(to);
        }
      }
    } else {
      for (int i = 0; i < rev[p.first][p.second].size(); i++) {
        pair<int, int> to = rev[p.first][p.second][i];
        if (++now[to.first][to.second] == sz[to.first][to.second]) {
          val[to.first][to.second] = 0;
          q.push(to);
        }
      }
    }
  }
}
int cnt[2][5], ID[2];
int main() {
  calc(0, 0, 0);
  pre();
  int T;
  for (gn(T); T--;) {
    int fl;
    gn(fl);
    memset(cnt, 0, sizeof(cnt));
    for (int i = 0; i < 2; i++) {
      for (int j = 0; j < 8; j++) {
        int a;
        gn(a);
        cnt[i][a]++;
      }
      ID[i] = id[get(cnt[i])];
    }
    if (fl) swap(ID[0], ID[1]);
    if (val[ID[0]][ID[1]] == -1)
      puts("Deal");
    else if (val[ID[0]][ID[1]] == 1)
      puts(fl ? "Bob" : "Alice");
    else
      puts(fl ? "Alice" : "Bob");
  }
  return 0;
}