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;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
const int NCARDS = 8;
const int NVALS = 5;
const int NSTATE = 495;
vector<vector<int> > states;
map<vector<int>, int> mp;
void genstates(vector<int> &v, int at, int rem) {
  if (at >= ((int)(v).size())) {
    if (rem == 0) {
      int id = ((int)(states).size());
      states.push_back(v);
      mp[v] = id;
    }
    return;
  }
  for (v[at] = 0; v[at] <= rem; ++v[at]) genstates(v, at + 1, rem - v[at]);
}
int nxt[NSTATE][NVALS][NVALS];
vector<int> adj[NSTATE][NSTATE];
vector<int> radj[NSTATE][NSTATE];
int deg[NSTATE][NSTATE];
int dp[NSTATE][NSTATE];
int q[NSTATE * NSTATE], qhead, qtail;
void precalc() {
  states.clear();
  mp.clear();
  vector<int> state(NVALS, 0);
  genstates(state, 0, NCARDS);
  for (int i = (0); i < (((int)(states).size())); ++i)
    for (int a = (0); a < (NVALS); ++a)
      for (int b = (0); b < (NVALS); ++b) {
        if (states[i][a] == 0) {
          nxt[i][a][b] = -1;
          continue;
        }
        vector<int> tmp = states[i];
        tmp[a]--;
        tmp[b]++;
        assert(mp.count(tmp));
        nxt[i][a][b] = mp[tmp];
      }
  for (int i = (0); i < (((int)(states).size())); ++i)
    for (int j = (0); j < (((int)(states).size())); ++j) {
      for (int a = (0); a < (NVALS); ++a)
        for (int b = (0); b < (NVALS); ++b)
          if (a * b != 0 && states[i][a] != 0 && states[j][b] != 0) {
            int c = (a + b) % NVALS;
            int ni = j, nj = nxt[i][a][c];
            assert(nj != -1);
            adj[i][j].push_back(ni * NSTATE + nj);
          }
      sort(adj[i][j].begin(), adj[i][j].end());
      adj[i][j].erase(unique(adj[i][j].begin(), adj[i][j].end()),
                      adj[i][j].end());
      for (int k = (0); k < (((int)(adj[i][j]).size())); ++k) {
        int ii = adj[i][j][k] / NSTATE, jj = adj[i][j][k] % NSTATE;
        radj[ii][jj].push_back(i * NSTATE + j);
      }
    }
  int winid = ((int)(states).size()) - 1;
  for (int i = (0); i < (((int)(states).size())); ++i)
    for (int j = (0); j < (((int)(states).size())); ++j)
      dp[i][j] = 0, deg[i][j] = ((int)(adj[i][j]).size());
  qhead = qtail = 0;
  for (int i = (0); i < (((int)(states).size())); ++i)
    dp[i][winid] = -1, q[qhead++] = i * NSTATE + winid;
  while (qtail < qhead) {
    int i = q[qtail] / NSTATE, j = q[qtail] % NSTATE;
    ++qtail;
    for (int k = (0); k < (((int)(radj[i][j]).size())); ++k) {
      int ii = radj[i][j][k] / NSTATE, jj = radj[i][j][k] % NSTATE;
      if (dp[ii][jj] != 0) continue;
      if (dp[i][j] == -1) {
        dp[ii][jj] = 1;
        q[qhead++] = ii * NSTATE + jj;
        continue;
      }
      if (--deg[ii][jj] == 0) {
        dp[ii][jj] = -1;
        q[qhead++] = ii * NSTATE + jj;
        continue;
      }
    }
  }
}
int fst;
int a[NCARDS], b[NCARDS];
void run() {
  int nq;
  scanf("%d", &nq);
  for (int qi = (0); qi < (nq); ++qi) {
    scanf("%d", &fst);
    for (int i = (0); i < (NCARDS); ++i) scanf("%d", &a[i]);
    for (int i = (0); i < (NCARDS); ++i) scanf("%d", &b[i]);
    vector<int> acnt(NVALS, 0), bcnt(NVALS, 0);
    for (int i = (0); i < (NCARDS); ++i) acnt[a[i]]++, bcnt[b[i]]++;
    assert(mp.count(acnt) && mp.count(bcnt));
    int aid = mp[acnt], bid = mp[bcnt];
    int ans = fst == 0 ? dp[aid][bid] : -dp[bid][aid];
    printf("%s\n", ans > 0 ? "Alice" : ans < 0 ? "Bob" : "Deal");
  }
}
int main() {
  precalc();
  run();
  return 0;
}