You are given a rooted tree with n vertices. Here, A and B are playing with the tree. In each turn (starting with A), each player can select a vertex v that contains no parent and delete a path with at least two vertices starting from v.
A player loses if he or she cannot make the turn in the game. For each test case, determine who will win.
Input format
Output format
For each test case, print A if A wins, otherwise print B.
Constraints
1≤n≤5×104
1≤pi≤i
1≤t≤10
In the first test, player B will always have a path of two vertices after A's move that will finish the game, so B is the winner.
In the second test, after any player A's choice for the path, the tree will become a set of vertices without any edge, so A is the winner.