#include #include using namespace std; typedef vector> graph; bool f(graph& g, int ord[], int low[], int p, int u) { bool flag = false; int k = ord[u]+1; for (int v : g[u]) { if (ord[v] < 0) { ord[v] = k++; low[v] = ord[v]; flag = f(g, ord, low, 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] = {}; for (int i = 1; i < n; i++) ord[i] = -1; bool bridge = f(g, ord, low, -1, 0); int count = 0; for (int i = 0; i < n; i++) { if (ord[i] < 0) count++; } if (count > 1) cout << "Alice" << endl; else if (count == 1) { cout << (bridge ? "Alice" : "Bob") << endl; } else cout << "Bob" << endl; }