#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using namespace atcoder; using Graph = vector>; using ll = long long; typedef pair P_ll; typedef pair P; const ll INF_ll = 1e17; const int INF = 1e8; template bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; } template bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; } template using min_priority_queue = priority_queue, greater>; int main() { int N; cin >> N; dsu tree(N); Graph G(N); for (int i = 0; i < N - 1; i++) { int u, v; cin >> u >> v; tree.merge(u, v); G[u].push_back(v); G[v].push_back(u); } auto group = tree.groups(); if (group.size() == 1) { cout << "Bob" << endl; return 0; } if (group.size() > 2) { cout << "Alice" << endl; return 0; } if (group[0].size() == N - 1) { for (auto v : group[0]) { if (G[v].size() != 2) { cout << "Alice" << endl; return 0; } } cout << "Bob" << endl; return 0; } if (group[1].size() == N - 1) { for (auto v : group[1]) { if (G[v].size() != 2) { cout << "Alice" << endl; return 0; } } cout << "Bob" << endl; return 0; } cout << "Alice" << endl; return 0; }