#include<bits/stdc++.h>
using namespace std;
#define ll long long
int read()
{
	char ch=getchar();int x=0,f=1;
	while(ch<'0'||ch>'9'){if(ch=='-') f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
int discard_pre[6]={3,4,2,1,5};
int playcard_pre[6]={2,1,3,5,4};
int reborn_pre[5]={5,2,3,4,1};
int distroy_pre[5]={4,5,3,2,1};
int pp;
struct player
{
	int deck[55],hand[15],field[15],die[15],pla,num[15];
	bool canuse(int x);
	bool cmp_playcard(int x,int y)
	{
		if(field[x]&&!field[y]) return x>y;
		if(!field[x]&&field[y]) return x<y;
		if(!field[x]&&!field[y])
		{
			int r1=0,r2=0;
			if(canuse(x)) r1=1;
			if(canuse(y)) r2=1;
			if(r1!=r2) return r1>r2;
			return playcard_pre[x]<playcard_pre[y];
		}
		return playcard_pre[x]<playcard_pre[y];
	}
	bool cmp_discard(int x,int y)
	{
		if(hand[x]!=hand[y]) return hand[x]>hand[y];
		return discard_pre[x]<discard_pre[y];
	}
	bool cmp_reborn(int x,int y)
	{
		if(hand[x]+field[x]!=hand[y]+field[y]) return hand[x]+field[x]<hand[y]+field[y];
		return reborn_pre[x]<reborn_pre[y];
	}
	bool cmp_distroy(int x,int y)
	{
		if(field[x]!=field[y]) return field[x]<field[y];
		return distroy_pre[x]<distroy_pre[y];
	}
	void trydraw()
	{
		if(pla>25) return;
		hand[deck[pla++]]++;
	}
	bool checkwin()
	{
		bool ok=1;
		for(int i=0;i<=4;i++)
		if(field[i]) ok=0;
		return ok;
	}
	void discard()
	{
		for(int i=0;i<=4;i++) num[i]=i;
		sort(num,num+4,cmp_discard);
		if(hand[num[0]]!=0) hand[num[0]]--,die[num[0]]++;
	}
	void reborn()
	{
		for(int i=0;i<=4;i++) num[i]=i;
		sort(num,num+4,cmp_reborn);
		for(int i=0;i<=4;i++)
		{
			if(die[num[i]])
			{
				die[num[i]]--;
				hand[num[i]]++;
				return;
			}
		}
	}
	void distroy()
	{
		for(int i=0;i<=4;i++) num[i]=i;
		sort(num,num+4,cmp_distroy);
		for(int i=0;i<=4;i++)
		{
			if(field[num[i]])
			{
				field[num[i]]--;
				die[num[i]]++;
			}
		}
	}
}a,b;
bool player::canuse(int x)
{
	if(x==0)
	{
		if(pla>25) return 0;
		return 1; 
	}
	else if(x==1)
	{
		
	}
}
int playcard(player &now,player &op)
{
	for(int i=0;i<=4;i++) now.num[i]=i;
	
	sort(now.num,now.num+4,now.cmp_playcard);
	for(int i=0;i<=4;i++)
	{
		if(now.hand[i]) return i;
	}
}
bool counter(int play,int tp)
{
	player now,op;
	if(play==1) now=b,op=a;
	else now=a,op=b;
	int num=0,cou;
	for(int i=0;i<=4;i++)
	{
		if(i==tp||op.field[i]) num++;
		else
		{
			cou=op.die[i];		
		}
	}
	if(num!=4) return 0;
	if(cou==5) return 0;
	if(now.hand[3])
	{
		num=0;
		for(int i=0;i<=4;i++) num+=now.hand[i];
		if(num==1) return 0;
		else
		{
			now.hand[3]--;
			now.die[3]++;
			now.discard();
			return 1;
		}
	}
	else return 0;
}
int main()
{
	int T=read();
	for(int ii=1;ii<=T;ii++)
	{
		memset(a,0,sizeof(a));
		memset(b,0,sizeof(b));
		for(int i=1;i<=25;i++) a.deck[i]=read();
		for(int i=1;i<=25;i++) b.deck[i]=read();
		printf("Case %d: ",ii);
		for(int i=1;i<=5;i++)
		{
			a.hand[a.deck[i]]++;
			b.hand[b.deck[i]]++;
		}
		a.pla=6;b.pla=6;
		int ok=0;
		for(int i=1;i<=100;i++)
		{
			player now,op;pp=i&1;
			if(i&1)
			{now=a;op=b}
			else {now=b;op=a;}
			now.trydraw();
			int tp=playcard(now,op);
			if(!counter(1,tp))
			{
				now.die[tp]++;
			}
			else
			{
				if(tp==0) now.trydraw();
				else if(tp==1)
				{
					op.discard();
				}
				else if(tp==2)
				{
					op.distroy();
				}
				else if(tp==4)
				{
					now.reborn();
				}
			}
			if(now.checkwin())
			{
				if(i&1)
				printf("Alice %d\n",i);
				else
				printf("Bob %d\n",i);
				ok=1;
				break;
			}
		}
		if(!ok)
		{
			printf("Draw 100\n");
		}
	}
}
