#include #include #include #include #include #include #include #include #include #include #include #include #define vll vector #define vvv vector #define vvi vector > #define vvl vector > #define vv(a, b, c, d) vector >(a, vector(b, c)) #define vvvl(a, b, c, d) vector(a, vvl(b, vll (c, d))); #define rep(c, a, b) for(ll c=a;c par, dep, sz; UF(int n){ par.resize(n+1), dep.resize(n+1), sz.resize(n+1); init(n); } void init(int nu) { for(int iu=0;iu<=nu;iu++){ par[iu] = iu; dep[iu] = 0; sz[iu] = 1; } } int find(int xu){ if(par[xu] == xu) return xu; return par[xu] = find(par[xu]); } void unite(int xu, int yu){ xu=find(xu); yu=find(yu); if(xu == yu) return; if(dep[xu] < dep[yu]){ sz[yu] += sz[xu]; par[xu] = yu; }else{ par[yu] = xu; sz[xu] += sz[yu]; if(dep[xu] == dep[yu]) dep[xu]++; } } bool same(int xu, int yu){ return find(xu) == find(yu); } }; int main(int argc, char const *argv[]) { ll a, b, n;std::cin >> n; UF uf(n+1); vll c(n, 0); re(i, n-1){ std::cin >> a >> b; uf.unite(a, b); c[a]++, c[b]++; } set s; re(i, n) s.insert(uf.find(i)); if(s.size()==1){ std::cout << "Bob" << '\n'; return 0; } if(s.size()==2){ ll t = 0; re(i, n) if(c[i]==2) t++; if(t==n-1) std::cout << "Bob" << '\n'; else std::cout << "Alice" << '\n'; return 0; } std::cout << "Alice" << '\n'; return 0; }