You are given a rooted tree with vertices. Here, and are playing with the tree. In each turn (starting with ), each player can select a vertex that contains no parent and delete a path with at least two vertices starting from .
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 if wins, otherwise print .
Constraints
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.