#include<cstdio>#include<vector>#include<cstring>
using namespace std;typedeflonglong ll;constint N =1e3+10;int sg[N][N];int dir[][2]={
1,-2,-1,-3,-1,-2,-2,-1,-3,-1,-2,1};intgetSG(int x,int y){
if(sg[x][y]!=-1)return sg[x][y];
bool vis[N]={
false };for(int i =0; i <6;++i){
int xx = x + dir[i][0], yy = y + dir[i][1];if(xx >=0&& yy >=0){
vis[getSG(xx, yy)]=1;}}for(int i =0;;++i){
if(!vis[i]){
return sg[x][y]= i;}}}intmain(){
memset(sg,-1,sizeof sg);int T, cas =0;scanf("%d",&T);while(T--){
int n, ans =0;scanf("%d",&n);for(int i =1; i <= n;++i){
int x, y;scanf("%d %d",&x,&y);
ans ^=getSG(x, y);}printf("Case %d: ",++cas);if(ans)puts("Alice");elseputs("Bob");}return0;}