#include #include using namespace std; typedef vector> graph; bool f(graph& g, int ord[], int low[], int& k, int p, int u) { bool flag = false; ord[u] = k++; low[u] = ord[u]; for (int v : g[u]) { if (ord[v] < 0) { flag = flag || f(g, ord, low, k, u, v); low[u] = min(low[u], low[v]); if (ord[u] < low[v]) flag = true; } else if (v != p) { low[u] = min(low[u], ord[v]); } } return flag; } int main() { int n; cin >> n; graph g(n); for (int i = 0; i < n-1; i++) { int u, v; cin >> u >> v; g[u].push_back(v); g[v].push_back(u); } int ord[n], low[n], k = 0; for (int i = 0; i < n; i++) ord[i] = -1; bool bridge1 = f(g, ord, low, k, -1, 0); int count = 1; bool bridge2 = false; for (int i = 0; i < n; i++) { if (ord[i] < 0) { bridge2 = f(g, ord, low, k, -1, i); count++; } } if (count > 2) cout << "Alice" << endl; else if (count == 2) { cout << (bridge1 || bridge2 ? "Alice" : "Bob") << endl; } else cout << "Bob" << endl; }