#include #define ll long long #define fornum(A,B,C) for(A=B;A #define pll pair using namespace std; ///////////////////////////////////////////////////// ll N; vector uvv[101010]; ll mk[101010]; ll i, j, k,ans; //Unionĉœ¨ struct UnionFind{ vector nxt; void init(int x){ nxt.clear(); nxt.resize(x); for (int i = 0; i < x;i++){ nxt[i] = i; } } int find(int x){ if(nxt[x]==x) return x; return nxt[x] =find(nxt[x]); } inline void unite(int x,int y){ nxt[find(y)] = find(x); } }; ll bfs(ll a,ll p,ll s){ //printf("%lld ", a); if(uvv[a].size()!=2){ return -1; } fornum(i,0,uvv[a].size()){ ll b = uvv[a][i]; if(b==p) continue; if(b==s) return 1; ll c = bfs(b, a,s); if(c==-1) return -1; return c+1; } return -1; } int main(){ scanf("%lld", &N); UnionFind uf; uf.init(N); fornum(i,1,N){ ll u, v; scanf("%lld%lld", &u, &v); uvv[u].push_back(v); uvv[v].push_back(u); uf.unite(u, v); } ll a = 0; fornum(i,0,N){ if(uf.find(i)==i){ a++; } } //printf("%lld %lld %lld\n",a,b, i); if(a>2){ printf("Alice"); }else if(a==1){ printf("Bob"); }else{ fornum(i,0,N){ if(uf.find(i)==i&&uvv[i].size()>0){ //printf("%lld\n", bfs(i, 0, i)); if(N-1!=bfs(i,-1,i)) break; } } if(i==N){ printf("Bob"); }else{ printf("Alice"); } } return 0; }