#include <iostream>
#include <vector>
using namespace std;
const int MAX = 100005;
int sg[MAX], cnt, head[MAX];
bool vst[MAX];
typedef struct node_
{
int v;
int next;
}N;
N edge[2 * MAX];
void addEdge(int u, int v)
{
edge[cnt].v = v;
edge[cnt].next = head[u];
head[u] = cnt++;
edge[cnt].v = u;
edge[cnt].next = head[v];
head[v] = cnt++;
}
int dfs(int n)
{
vst[n] = true;
if(sg[n] != -1)
return sg[n];
if(head[n] == -1)
return sg[n] = 0;
vector<int> sg_son;
for(int f = head[n]; f != -1; f = edge[f].next)
{
int son = edge[f].v;
if(vst[son] == false)
sg_son.push_back(dfs(son));
}
int yihuo = 0;
for(unsigned i = 0; i < sg_son.size(); i++)
{
yihuo ^= sg_son[i] + 1;
}
return sg[n] = yihuo;
}
void init()
{
cnt = 0;
memset(head, -1, sizeof(head));
memset(sg, -1, sizeof(sg));
memset(vst, false, sizeof(vst));
}
int main(void)
{
#ifndef ONLINE_JUDGE
freopen("in.txt", "r", stdin);
#endif
int cas;
scanf("%d", &cas);
while(cas--)
{
init();
int n;
scanf("%d", &n);
for(int i = 0; i < n - 1; i++)
{
int u, v;
scanf("%d %d", &u, &v);
addEdge(u, v);
addEdge(v, u);
}
int flag = dfs(1);
if(!flag)
printf("Bob\n");
else
printf("Alice\n");
}
return 0;
}