#include using namespace std; #ifdef LOCAL_DEBUG #include "LOCAL_DEBUG.hpp" #endif #define int long long struct UnionFind{ vector par; //親 vector size; //集合の大きさ UnionFind(int n){ par.resize(n); size.resize(n, 1); for(int i = 0; i < n; i++){ par[i] = i; } } //木の根を求める int root(int x){ if(par[x] == x){ return x; }else{ return par[x] = root(par[x]); } } //xとyの属する集合を併合 void unite(int x,int y){ x = root(x), y = root(y); if(x == y) return; if(size[x] < size[y]) swap(x,y); par[y] = x; size[x] += size[y]; } bool same(int x, int y){ return root(x) == root(y); } }; signed main(){ int n; cin >> n; UnionFind uf(n); vector indeg(n, 0); for(int i = 0; i < n-1; i++){ int u, v; cin >> u >> v; uf.unite(u, v); indeg[u]++; indeg[v]++; } if(uf.size[uf.root(0)] == n-1){ int cnt = 0; for(int i = 0; i < n; i++){ if(indeg[i] < 2) cnt++; } cout << (cnt < 2 ? "Bob" : "Alice") << endl; }else{ cout << (uf.size[uf.root(0)] == n ? "Bob" : "Alice") << endl; } return 0; }