Problem:
Score : 1100 points

Problem Statement

There is a tree with N vertices numbered 1, 2, ..., N.
The edges of the tree are denoted by (x_i, y_i).

On this tree, Alice and Bob play a game against each other.
Starting from Alice, they alternately perform the following operation:

Select an existing edge and remove it from the tree, disconnecting it into two separate connected components. Then, remove the component that does not contain Vertex 1.

A player loses the game when he/she is unable to perform the operation.
Determine the winner of the game assuming that both players play optimally.

Constraints

2 \leq N \leq 100000

1 \leq x_i, y_i \leq N

The given graph is a tree.

Input

Input is given from Standard Input in the following format:

N
x_1 y_1
x_2 y_2
:
x_{N-1} y_{N-1}

Output

Print Alice if Alice wins; print Bob if Bob wins.

Sample Input 1

5
1 2
2 3
2 4
4 5

Sample Output 1

Alice

If Alice first removes the edge connecting Vertices 1 and 2, the tree becomes a single vertex tree containing only Vertex 1.
Since there is no edge anymore, Bob cannot perform the operation and Alice wins.

Sample Input 2

5
1 2
2 3
1 4
4 5

Sample Output 2

Bob

Sample Input 3

6
1 2
2 4
5 1
6 3
3 2

Sample Output 3

Alice

Sample Input 4

7
1 2
3 7
4 6
2 3
2 4
1 5

Sample Output 4

Bob

Solution in Julia (0.5.0) (judge verdict: Wrong Answer)

parseInt(x) = parse(Int, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)

function main()
	n = readline() |> parseInt
	e = [Int[] for i in 1:n]
	for i in 1:n-1
		x,y = readline() |> split |> parseMap
		push!(e[x],y)
		push!(e[y],x)
	end
	v = -ones(Int,n)
	t = -ones(Int,n)
	t[1] = 0
	v[1] = 0
	stack = Int[1]
	while !isempty(stack)
		now = shift!(stack)
		for i in e[now]
			if t[i] == -1
				t[i] = t[now]+1
				v[i] = now
				push!(stack,i)
			end
		end
	end
	m = maximum(t)
	z = Tuple{Int,Int}[(t[i],i) for i in 1:n]
	z = sort(z,by=x->x[1],rev=true)
	val = -ones(Int,n)
	for key in 1:n
		i = z[key][2]
		if i!=1&&length(e[i]) == 1
			val[i] = 0
		else
			if i!=1&&length(e[i])==2 || i==1&&length(e[i])==1
				for j in 1:length(e[i])
					if e[i][j] != v[i]
						val[i] = val[e[i][j]] + 1
					end
				end
			else
				val[i] = 0
				for j in 1:length(e[i])
					if e[i][j] != v[i]
						val[i] = val[e[i][j]]$val[i]
					end
				end
			end
		end
	end
	println(val[1]>0?"Alice":"Bob")
end

main()