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>
inline T read() {
  T f = 0, x = 0;
  char c = getchar();
  while (!isdigit(c)) f = c == '-', c = getchar();
  while (isdigit(c)) x = x * 10 + c - 48, c = getchar();
  return f ? -x : x;
}
namespace run {
vector<vector<int> > sta;
vector<int> st;
int num, f[495 * 495], vis[495 * 495];
inline void dfs(int x, int sum) {
  if (x == 5) {
    if (!sum) sta.push_back(st), num++;
    return;
  }
  dfs(x + 1, sum);
  for (int i = 1; i <= sum; i++) st.push_back(x), dfs(x + 1, sum - i);
  for (int i = 1; i <= sum; i++) st.pop_back();
}
const int N = 8e6 + 9;
int head[N], nex[N], to[N], cnt, deg[N];
queue<int> q;
inline void add(int u, int v) {
  nex[++cnt] = head[u], head[u] = cnt, to[cnt] = v;
}
inline int id(vector<int> a) {
  return lower_bound(sta.begin(), sta.end(), a) - sta.begin();
}
inline void pre() {
  sort(sta.begin(), sta.end());
  for (int i = 0; i < num; i++)
    for (int p = 0; p < 8; p++)
      if (sta[i][p] && (!p || (p && sta[i][p - 1] != sta[i][p]))) {
        for (int k = 1; k < 5; k++) {
          vector<int> a = sta[i];
          a[p] = (a[p] + k) % 5, sort(a.begin(), a.end());
          int tmp = id(a);
          for (int j = 0; j < num; j++) {
            int peg = 0;
            for (int l = 0; l < 8; l++)
              if (sta[j][l] == k) {
                peg = 1;
                break;
              }
            if (peg) add(j * num + tmp, i * num + j), deg[i * num + j]++;
          }
        }
      }
  memset(f, -1, sizeof f);
  for (int i = 1; i < num; i++) q.push(i), vis[i] = 1, f[i] = 1;
  for (int i = 1; i < num; i++)
    q.push(i * num), vis[num * i] = 1, f[num * i] = 0;
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (int i = head[u]; i; i = nex[i]) {
      if (!f[u]) f[to[i]] = 1;
      if (f[to[i]] == 1 && !vis[to[i]]) q.push(to[i]), vis[to[i]] = 1;
      if (!--deg[to[i]] && !vis[to[i]])
        f[to[i]] = 0, q.push(to[i]), vis[to[i]] = 1;
    }
  }
}
int main() {
  dfs(0, 8), assert(sta.size() == 495), pre();
  int T = read<int>();
  while (T--) {
    vector<int> a, b;
    a.clear(), b.clear();
    int _f = read<int>();
    for (int i = 0; i < 8; i++) a.push_back(read<int>());
    for (int i = 0; i < 8; i++) b.push_back(read<int>());
    if (_f) swap(a, b);
    sort(a.begin(), a.end()), sort(b.begin(), b.end());
    int tmp = num * id(a) + id(b), ret = f[tmp];
    if (ret == -1)
      puts("Deal");
    else if (_f ^ ret)
      puts("Alice");
    else
      puts("Bob");
  }
  return 0;
}
}  // namespace run
int main() { return run::main(); }