#pragma region Macros #include #if defined(LOCAL) || defined(ONLINE_JUDGE) || defined(_DEBUG) #include #endif using namespace std; #define REP(i, n) for(int i=0, i##_len=(n); i=0; --i) #define FOR(i, n, m) for(int i=(m), i##_len=(n); ibool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (busing vec = vector; templateusing umap = unordered_map; templateusing uset = unordered_set; using ll = long long; using ld = long double; using P = pair; //using T = tuple; using vl = vec; #define fi first #define se second #define el endl constexpr ll INF = numeric_limits::max()/2-1; #pragma endregion #pragma region IOMacros template istream &operator>>(istream &stream, vec& o){REP(i, o.size())stream >> o[i];return stream;} template ostream &operator<<(ostream &stream, vec& objs){REP(i, objs.size())stream << objs[i] << " ";stream << el;return stream;} #define I(T, ...) ;T __VA_ARGS__;__i(__VA_ARGS__); void __i() {} template void __i(T&& o, Ts&&... args){cin >> o;__i(forward(args)...);} void O() {cout << el;} template void O(T&& o, Ts&&... args){cerr << o << " ";O(forward(args)...);} #pragma endregion void Main(); int main(){ std::cin.tie(nullptr); std::cout << std::fixed << std::setprecision(15); Main(); return 0; } #pragma region UnionFind // https://qiita.com/DaikiSuyama/items/444e409423bd1b4b83d7 class UnionFind{ public: vector parent; //parent[i]はiの親 vector siz; //素集合のサイズを表す配列(1で初期化) umap> group; //集合ごとに管理する(key:集合の代表元、value:集合の要素の配列) ll n; //要素数 UnionFind(ll n_):n(n_),parent(n_),siz(n_,1){ //全ての要素の根が自身であるとして初期化 for(ll i=0;i(n,1); group.clear(); } }; #pragma endregion void Main(){ I(ll, N); UnionFind uf(N); vl A(N); REP(i, N-1){ I(ll, S, T); uf.unite(S, T); A[S]++; A[T]++; } uf.grouping(); bool t = count(ALL(A), 2) == A.size()-1; cerr << uf.group.size() << el; cout << (uf.group.size()!=1&&!t?"Alice":"Bob") << el; }