Alice and Bob are playing a game on a tree $$$T$$$ whose root is $$$1$$$. $$$T$$$ has $$$n$$$ vertices and $$$n-1$$$ edges, each vertex has an attribute $$$a \in \{1,2,3\}$$$. If $$$a=1$$$, a person on this vertex $$$v$$$ must jump to the parent of $$$v$$$, i.e., $$$v->parent$$$. If $$$a=2$$$, a person on this vertex $$$v$$$ must jump to $$$v$$$'s grandparent, i.e., v->parent->parent
. If $$$a=3$$$, a person on this vertex can either jump to v->parent
or v->parent->parent
. Alice starts the first and she can choose which vertex to start. If somebody cannot make a move, she/he loses the game. For example, if Alice stands on a child of the root and this child has attribute $$$2$$$, then Alice loses as this child does not have a grandparent. Similarly if Bob stands on the root, he will lose as he cannot move no matter what the attribute of the root is.
Input contains $$$n+1$$$ lines.
The first line contains a single integer $$$n$$$, which is the number of vertices.
The second line contains $$$n$$$ integers $$$a_i$$$ representing the attribute of each vertex $$$i$$$.
The following $$$n-1$$$ lines representing edges, each line contains two integers $$$u_i$$$ and $$$v_i$$$. $$$u_i$$$-$$$v_i$$$ is an undirected edge of the tree $$$T$$$.
Output should contain $$$n-1$$$ lines, each line is a query. The $$$i$$$-th ($$$1 \leq i \leq n-1$$$) line represents the winner if Alice and Bob plays optimally when the $$$i$$$-th edge is deleted from $$$T$$$. The deletion operations are independent along queries, i.e., the $$$i$$$-th edge is recovered from deletion when you process the $$$i+1$$$-th query.
Test cases:
Input:
3
1 2 1
1 2
1 3
Output:
Alice
Bob