#include #include #include #define llint long long using namespace std; struct UnionFind{ int size; vector parent; UnionFind(){} UnionFind(int size){ this->size = size; parent.resize(size+1); init(); } void init(){ for(int i = 0; i <= size; i++) parent[i] = i; } int root(int i){ if(parent[i] == i) return i; return parent[i] = root(parent[i]); } bool same(int i, int j){ return root(i) == root(j); } void unite(int i, int j){ int root_i = root(i), root_j = root(j); if(root_i == root_j) return; parent[root_i] = root_j; } }; llint n; vector G[100005]; UnionFind uf(100005); set S; int main(void) { ios::sync_with_stdio(0); cin.tie(0); cin >> n; llint u, v; for(int i = 1; i <= n-1; i++){ cin >> u >> v; u++, v++; G[u].push_back(v); G[v].push_back(u); uf.unite(u, v); } for(int i = 1; i <= n; i++) S.insert(uf.root(i)); if(S.size() >= 3){ cout << "Alice" << endl; return 0; } if(S.size() == 1){ cout << "Bob" << endl; return 0; } bool flag0 = false, flag2 = true; for(int i = 1; i <= n; i++){ if(G[i].size() != 2){ if(G[i].size() == 0) flag0 = true; else flag2 = false; } } if(flag0 && flag2) cout << "Bob" << endl; else cout << "Alice" << endl; return 0; }