#include #include #include using namespace std; //B struct UnionFind { vector par; int N; UnionFind(int n) : N(n),par(n){ for(int i = 0; n > i; i++)par[i] = i; } int root(int n){ if(par[n] == n)return n; return par[n] = root(par[n]); } void unite(int a,int b){ int ra = root(a); int rb = root(b); if(ra==rb)return; par[ra] = rb; } bool same(int a, int b){ return root(a) == root(b); } int size(){ set A; for(int i = 0; N > i; i++){ A.insert(root(i)); } return A.size(); } int rootsize(){ int re = 0; for(int i = 1; N > i; i++){ if(same(0,i))re++; } return re+1; } }; //E int main(){ int n;cin>>n; UnionFind A(n); vector Z[100000]; for(int i = 0; n-1 > i; i++){ int a,b;cin>>a>>b; A.unite(a,b); Z[a].push_back(b); Z[b].push_back(a); } if(A.size() == 2){ //片方の島が1つだけの時はBob if(A.rootsize() == 1 || A.rootsize() == n-1){ cout << "Bob" << endl; }else{ cout << "Alice" << endl; } }else if(A.size() == 1){ cout << "Bob" << endl; }else{ cout << "Alice" << endl; } }