#define _USE_MATH_DEFINES #include "bits/stdc++.h" using namespace std; #define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i)) #define rep(i,j) FOR(i,0,j) #define each(x,y) for(auto &(x):(y)) #define mp make_pair #define MT make_tuple #define all(x) (x).begin(),(x).end() #define debug(x) cout<<#x<<": "<<(x)<; using vi = vector; using vll = vector; class UnionFindBySize { int cnt; vector par, size; public: UnionFindBySize() :cnt(0) {} UnionFindBySize(int _n) :cnt(_n), par(_n), size(_n, 1) { for (int i = 0; i < _n; ++i) par[i] = i; } int find(int k) { return (k == par[k]) ? k : (par[k] = find(par[k])); } int operator[](int k) { return find(k); } int getSize(int k) { return size[find(k)]; } void unite(int x, int y) { x = find(x); y = find(y); if (x == y) return; --cnt; if (size[x] < size[y]) { par[x] = y; size[y] += size[x]; } else { par[y] = x; size[x] += size[y]; } } int count() { return cnt; } }; void solve() { int N; cin >> N; UnionFindBySize UF(N); vi A(N); // ループはあるか rep(i, N - 1) { int u, v; cin >> u >> v; u = UF[u]; v = UF[v]; if (UF.getSize(u) < UF.getSize(v))swap(u, v); if (u == v) { A[u] = 1; } else { UF.unite(u, v); A[u] |= A[v]; } } if (UF.count() > 2) { cout << "Alice" << endl; return; } if (UF.count() ==2) { rep(i, N) { int u = UF[i]; if (UF.getSize(u) > 1 && !A[u]) { cout << "Alice" << endl; return; } } } cout << "Bob" << endl; } int main() { ios::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(15); solve(); return 0; }