#include using namespace std; bool dfs(const vector> &to, vector &isvisited, int index, int prev, bool isrepeated) { isvisited.at(index) = true; for (int next : to.at(index)) { if (next == prev) continue; if (isvisited.at(next)) { if (isrepeated) return false; vector isvisited_new(isvisited.size()); dfs(to, isvisited_new, next, -1, true); int period = 0; for (bool x : isvisited_new) { if (x) period++; } return period == isvisited.size() - 1; } if (dfs(to, isvisited, next, index, isrepeated) == false) return false; } return true; } int main() { int n; cin >> n; vector> to(n); for (int i = 0; i < n - 1; i++) { int u, v; cin >> u >> v; to.at(u).push_back(v); to.at(v).push_back(u); } vector isvisited(n); for (int i = 0; i < n; i++) { if (isvisited.at(i)) continue; if (!dfs(to, isvisited, i, -1, false)) { cout << "Alice" << endl; return 0; } } cout << "Bob" << endl; }