N = gets.to_i G = Hash.new { |h, k| h[k] = [] } (N - 1).times do u, v = gets.split.map(&:to_i) G[u] << v G[v] << u end def dfs(v, root, visited) visited[v] = true G[v].each do |u| next if visited[u] dfs(u, root, visited) end end visited = Hash.new(false) cnt = 0 N.times do |i| next if visited[i] cnt += 1 dfs(i, i, visited) end if cnt >= 3 puts 'Alice' elsif cnt == 1 puts 'Bob' else c = (0...N).count { |v| G[v].size == 2 } if c == N - 1 puts 'Bob' else puts 'Alice' end end