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 JAVA):

Solution:
//package round460;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.util.List;
import java.util.Map;

public class F {
	InputStream is;
	PrintWriter out;
	String INPUT = "";
	List<int[]> all = new ArrayList<>();
	
	long h(int[] a)
	{
		long h = 0;
		for(int v : a){
			h = h * 1000000009 + v;
		}
		return h;
	}
	
	void solve()
	{
		dfs(0, 8, new int[5]);
		
		Map<Long, Integer> map = new HashMap<>();
		for(int i = 0;i < all.size();i++){
			map.put(h(all.get(i)), i);
		}
		
		int[][] win = new int[495][495];
		for(int i = 0;i < 495;i++){
			win[0][i] = 1;
		}
		
		int[][][] nexs = new int[495][495][];
		int[] ns = new int[16];
		for(int i = 0;i < 495;i++){
			for(int j = 0;j < 495;j++){
				int[] a = all.get(i);
				int[] b = all.get(j);
				int p = 0;
				for(int k = 1;k <= 4;k++){
					if(a[k] == 0)continue;
					for(int l = 1;l <= 4;l++){
						if(b[l] == 0)continue;
						int[] na = Arrays.copyOf(a, 5);
						na[k]--;
						na[(k+l)%5]++;
						ns[p++] = map.get(h(na));
					}
				}
				nexs[i][j] = Arrays.copyOf(ns, p);
			}
		}
		
		while(true){
			int ch = 0;
			
			for(int i = 0;i < 495;i++){
				inner:
				for(int j = 0;j < 495;j++){
					if(win[i][j] != 0)continue;
					int z = 0;
					for(int nex : nexs[i][j]){
						if(win[j][nex] == -1){
							win[i][j] = 1;
							ch++;
							continue inner;
						}
						if(win[j][nex] == 0)z = 1;
					}
					if(z == 0){
						win[i][j] = -1;
						ch++;
					}
				}
			}
			if(ch == 0)break;
		}
		
		for(int Q = ni();Q > 0;Q--){
			int turn = ni();
			if(turn == 0){
				int[] a = nf(8);
				int[] b = nf(8);
				int res = win[map.get(h(a))][map.get(h(b))];
				if(res == 1){
					out.println("Alice");
				}else if(res == -1){
					out.println("Bob");
				}else{
					out.println("Deal");
				}
			}else{
				int[] a = nf(8);
				int[] b = nf(8);
				int res = win[map.get(h(b))][map.get(h(a))];
				if(res == 1){
					out.println("Bob");
				}else if(res == -1){
					out.println("Alice");
				}else{
					out.println("Deal");
				}
			}
		}
	}
	
	int[] nf(int n)
	{
		int[] ret = new int[5];
		for(int i = 0;i < n;i++){
			ret[ni()]++;
		}
		return ret;
	}
	
	void dfs(int num, int rem, int[] a)
	{
		if(num == a.length){
			if(rem == 0){
				all.add(Arrays.copyOf(a, 5));
			}
			return;
		}
		
		for(int i = rem;i >= 0;i--){
			a[num] = i;
			dfs(num+1, rem-i, a);
		}
	}
	
	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);
		
		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}
	
	public static void main(String[] args) throws Exception { new F().run(); }
	
	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;
	
	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}
	
	private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
	private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }
	
	private double nd() { return Double.parseDouble(ns()); }
	private char nc() { return (char)skip(); }
	
	private String ns()
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}
	
	private char[] ns(int n)
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b))){
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}
	
	private char[][] nm(int n, int m)
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}
	
	private int[] na(int n)
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}
	
	private int ni()
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}
		
		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}
	
	private long nl()
	{
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}
		
		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}
	
	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}