#include <bits/stdc++.h> using namespace std; typedef long long ll; template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; } template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; } #define all(x) (x).begin(),(x).end() #define fi first #define se second #define mp make_pair #define si(x) int(x.size()) const int mod=998244353,MAX=300005,INF=15<<26; int grundy[305]; bool mita[305][505]; int main(){ std::ifstream in("text.txt"); std::cin.rdbuf(in.rdbuf()); cin.tie(0); ios::sync_with_stdio(false); for(int n=1;n<=200;n++){ memset(mita,0,sizeof(mita)); mita[0][0]=1; for(int i=0;i<n;i++){ for(int j=0;j<400;j++){ if(mita[i][j]){ for(int x=1;i+x<=n;x++){ mita[i+x][j^grundy[x]]=true; } } } } mita[n][0]=true; for(int j=0;;j++){ if(!mita[n][j]){ grundy[n]=j; break; } } //cout<<n<<" "<<grundy[n]<<endl; } int Q;cin>>Q; while(Q--){ ll N;cin>>N; ll X=0; for(int i=0;i<N;i++){ ll x;cin>>x; if(x<=2) X^=1; else if(x==3) X^=2; else{ ll T=(x-1)/3; T*=4; if(x%3==1) T-=2; X^=T; } } if(X) cout<<"Alice\n"; else cout<<"Bob\n"; } }