#include using namespace std; typedef long long ll; typedef vector vi; typedef vector vl; typedef pair pii; typedef int _loop_int; #define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i) #define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i) #define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i) #define DEBUG(x) cout<<#x<<": "< class UnionFind { vector parent; vector rank; public: UnionFind(T n) { init(n); } void init(T n) { parent.clear(); rank.clear(); for(int i=0; i>n; int bridges[N]={}; UnionFind uf(n); REP(i,n-1){ int u,v; cin>>u>>v; bridges[u]++; bridges[v]++; uf.unite(u,v); } bool is_united = true; int root = uf.find(0); FOR(i,1,n){ if(root != uf.find(i)){ is_united = false; break; } } bool flg = false; int cnt = 0; if(!is_united) cnt+=1; REP(i,n){ //DEBUG(bridges[i]); if(!flg&&bridges[i]==1){ flg=true; cnt++; } else if(bridges[i]==0){ cnt++; } if(cnt>=2){ cout << "Alice" << endl; return 0; } } cout << "Bob" << endl; return 0; }