#include #include #include #include #include #include #include #include #include #include using namespace std; struct aaa{aaa(){cin.tie(nullptr); ios::sync_with_stdio(false); cout<ostream &operator<<(ostream &o,const vector&v){o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<; vector bfs(const vector>& g) { int n = g.size(); vector visited(n, false); vector visit(n, 0); queue

q; q.emplace(-1,0); visit[0]++; while(!q.empty()) { auto [v, u] = q.front(); q.pop(); if (visited[u]) continue; visited[u] = true; for (auto vi : g[u]) { if (vi == v) continue; visit[vi]++; q.emplace(u, vi); } } return visit; } int main() { int64 n; cin >> n; vector> g(n); if (n == 2) { cout << "Bob" << endl; return 0; } for (int i = 0; i < n - 1; i++) { int64 u, v; cin >> u >> v; g[u].push_back(v); g[v].push_back(u); } vector v = bfs(g); sort(v.begin(), v.end()); bool ans = all_of(v.begin(), v.end(), [](int x){return x>0;}); auto it = lower_bound(v.begin(), v.end(), 2); ans = ans || (it - v.begin()) <= 1; cout << (ans? "Bob" : "Alice") << endl; }