#pragma once #include #define M_PI 3.14159265358979323846 // pi using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector VI; typedef pair P; typedef tuple t3; #define rep(a,n) for(int a = 0;a < n;a++) #define repi(a,b,n) for(int a = b;a < n;a++) const ll mod = 1000000007; struct UnionFind { public: vector par; // vector siz; // UnionFind(ll sz_) : par(sz_), siz(sz_, 1LL) { for (ll i = 0; i < sz_; ++i) par[i] = i; } void init(ll sz_) { par.resize(sz_); siz.assign(sz_, 1LL); for (ll i = 0; i < sz_; ++i) par[i] = i; } ll root(ll x) { while (par[x] != x) { x = par[x] = par[par[x]]; } return x; } bool merge(ll x, ll y) { x = root(x); y = root(y); if (x == y) return false; if (siz[x] < siz[y]) swap(x, y); siz[x] += siz[y]; par[y] = x; return true; } bool issame(ll x, ll y) { return root(x) == root(y); } ll size(ll x) { return siz[root(x)]; } }; int main(void) { ll n; cin >> n; UnionFind uf(n); rep(i, n-1) { ll a, b; cin >> a >> b; uf.merge(a, b); } unordered_map s; rep(i, n) { s[uf.root(i)]++; } if (s.size() > 2) { cout << "Alice" << endl; } else if(s.size() == 1){ cout << "Bob" << endl; } else { for (auto e : s) { if (e.second == 1) { cout << "Bod" << endl; return 0; } } cout << "Alice" << endl; } return 0; }