#define _USE_MATH_DEFINES #include using namespace std; //template #define rep(i,a,b) for(int i=(a);i<(b);i++) #define rrep(i,a,b) for(int i=(a);i>(b);i--) #define ALL(v) (v).begin(),(v).end() typedef long long int ll; const int inf = 0x3fffffff; const ll INF = 0x1fffffffffffffff; const double eps=1e-12; void tostr(ll x,string& res){while(x)res+=('0'+(x%10)),x/=10; reverse(ALL(res)); return;} template inline bool chmax(T& a,T b){ if(a inline bool chmin(T& a,T b){ if(a>b){a=b;return 1;}return 0; } //template end template struct UnionFind { vector par,rank; vector diff_weight; UnionFind(int n=1,Abel SUM_UNITY=0){init(n, SUM_UNITY);} void init(int n=1,Abel SUM_UNITY=0) { par.resize(n); rank.resize(n); diff_weight.resize(n); rep(i,0,n)par[i]=-1,rank[i]=0,diff_weight[i]=SUM_UNITY; } int root(int x){ if(par[x]<0)return x; int r=root(par[x]); diff_weight[x]+=diff_weight[par[x]]; return par[x]=r; } int size(int x){ return -par[root(x)]; } Abel weight(int x){root(x); return diff_weight[x];} bool issame(int x, int y){return root(x)==root(y);} bool merge(int x,int y,Abel w){ w+=weight(x)-weight(y); x=root(x); y=root(y); if(x==y)return false; if(rank[x] g[101000]; bool f=0; void dfs(int v,int p=-1){ if(v==0&&p!=-1){f=1; return;} for(int to:g[v])if(to==0||to!=p)dfs(to,v); } int main(){ int n; scanf("%d",&n); UnionFind uni(n); rep(i,0,n-1){ int u,v; scanf("%d%d",&u,&v); g[u].push_back(v); g[v].push_back(u); uni.merge(u,v,1); } set rts; rep(i,0,n)rts.insert(uni.root(i)); if(rts.size()==1)f=1; dfs(0); printf(f?"Bob\n":"Alice\n"); return 0; }