#include #include #include using namespace std; // 簡易UF struct UF{ vector p; int n; UF(int siz){ n = siz; p.resize(n, 0); for(int i = 0; i < n; i++) p[i] = i; } int parent(int x){ if(p[x] != x) p[x] = parent(p[x]); return p[x]; } bool same(int x, int y){ return parent(x) == parent(y); } void unite(int x, int y){ x = parent(x), y = parent(y); p[x] = y; } }; typedef pair pii; int main(){ int n; cin >> n; vector deg(n, 0); vector vp; UF uf(n); for(int i = 0; i < n-1; i++){ int u, v; cin >> u >> v; uf.unite(u, v); vp.push_back({u,v}); deg[u]++, deg[v]++; } set s; for(int i = 0; i < n; i++) s.insert(uf.parent(i)); if(s.size() > 2){ cout << "Alice" << endl; }else if(s.size() == 2){ for(int i = 0; i < n; i++){ if(deg[i] == 0){ cout << "Bob" << endl; return 0; } } cout << "Alice" << endl; } cout << "Bob" << endl; return 0; }