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;
const int MAXN = 500, MAXT = 200100;
int M[MAXT];
vector<int> V[MAXN];
vector<pair<int, int> > C[MAXN][MAXN];
int t;
int sol[MAXN][MAXN], cnt[MAXN][MAXN];
bool pass[MAXN][MAXN];
queue<pair<int, int> > W, L;
void WChildren(pair<int, int> p) {
  sol[p.first][p.second] = 1;
  vector<int> P = V[p.first], R = V[p.second];
  for (int i = (0); i < (int)(C[p.first][p.second].size()); i++) {
    pair<int, int> kid = C[p.first][p.second][i];
    if (pass[kid.first][kid.second]) continue;
    cnt[kid.first][kid.second]--;
    if (!cnt[kid.first][kid.second]) {
      pass[kid.first][kid.second] = true;
      L.push(kid);
    }
  }
}
void LChildren(pair<int, int> p) {
  sol[p.first][p.second] = 0;
  vector<int> P = V[p.first], R = V[p.second];
  for (int i = (0); i < (int)(C[p.first][p.second].size()); i++) {
    pair<int, int> kid = C[p.first][p.second][i];
    if (pass[kid.first][kid.second]) continue;
    W.push(kid);
    pass[kid.first][kid.second] = true;
  }
}
void correte() {
  while (W.size()) W.pop();
  while (L.size()) L.pop();
  sol[0][0] = 0;
  for (int i = (1); i < (int)(495); i++) {
    L.push(make_pair(0, i));
    L.push(make_pair(i, 0));
  }
  while (W.size() || L.size()) {
    while (W.size()) {
      WChildren(W.front());
      W.pop();
    }
    while (L.size()) {
      LChildren(L.front());
      L.pop();
    }
  }
}
int HASH(vector<int> &VV) {
  int ans = 0;
  for (int i = (0); i < (int)(5); i++) {
    ans *= 9;
    ans += VV[i];
  }
  return ans;
}
void getmapping() {
  for (int i = (0); i < (int)(MAXN); i++) V[i].clear();
  for (int i = (0); i < (int)(MAXT); i++) M[i] = 0;
  vector<int> X = {8, 0, 0, 0, 0};
  M[HASH(X)] = 0;
  V[0] = X;
  int tot = 1;
  for (int a = (0); a < (int)(8); a++)
    for (int b = (0); b < (int)(9); b++)
      for (int c = (0); c < (int)(9); c++)
        for (int d = (0); d < (int)(9); d++)
          for (int e = (0); e < (int)(9); e++) {
            if (a + b + c + d + e != 8) continue;
            X = {a, b, c, d, e};
            M[HASH(X)] = tot;
            V[tot++] = X;
          }
}
void getchildren() {
  for (int i = (0); i < (int)(495); i++)
    for (int j = (0); j < (int)(495); j++) {
      C[i][j].clear();
      cnt[i][j] = 0;
    }
  int it = 0;
  for (int ti = (1); ti < (int)(495); ti++)
    for (int tj = (1); tj < (int)(495); tj++) {
      vector<int> A = V[ti], B = V[tj], Aux = A;
      for (int i = (1); i < (int)(5); i++)
        for (int j = (1); j < (int)(5); j++)
          if (A[i] && B[j]) {
            Aux[i]--;
            Aux[(i + j) % 5]++;
            int pi = M[HASH(B)], pj = M[HASH(Aux)];
            C[pi][pj].push_back(make_pair(ti, tj));
            cnt[ti][tj]++;
            Aux[i]++;
            Aux[(i + j) % 5]--;
          }
    }
}
int main() {
  getmapping();
  getchildren();
  for (int i = (0); i < (int)(500); i++)
    for (int j = (0); j < (int)(500); j++) pass[i][j] = false;
  for (int i = (0); i < (int)(500); i++)
    for (int j = (0); j < (int)(500); j++) sol[i][j] = 2;
  correte();
  int t;
  scanf("%d", &t);
  for (int cs = (0); cs < (int)(t); cs++) {
    int st;
    scanf("%d", &st);
    vector<int> A(5, 0), B(5, 0);
    for (int i = (0); i < (int)(8); i++) {
      int x;
      scanf("%d", &x);
      A[x]++;
    }
    for (int i = (0); i < (int)(8); i++) {
      int x;
      scanf("%d", &x);
      B[x]++;
    }
    if (st) swap(A, B);
    switch (sol[M[HASH(A)]][M[HASH(B)]]) {
      case 0:
        cout << (st ? "Alice" : "Bob") << endl;
        break;
      case 1:
        cout << (st ? "Bob" : "Alice") << endl;
        break;
      case 2:
        cout << "Deal" << endl;
        break;
      default:
        assert(false);
    }
  }
  return 0;
}