#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 ans(n, -1); queue

q; q.emplace(0,0); while(!q.empty()) { auto [u, ni] = q.front(); q.pop(); if (ans[u] != -1) continue; ans[u] = ni; for (auto v : g[u]) { if (ni==n-1 && v == 0) ans[0] = n-1; else { q.emplace(v, ni+1); } } } return ans; } //void dfs(int64 u, int p, int64 n, const vector>& g, vector& visited, vector& path) { // // if (visited[u]) return; // // for(const auto& v : g[u]) { // if (v == p) continue; // dfs(v, u, n+1, g, visited, path); // } //} 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); bool ans = v[0] == n-1; ans = ans || any_of(v.begin(), v.end(), [&](int x){return x==n-1;}); cout << (ans? "Bob" : "Alice") << endl; }