#D726. Rooted Tree Game
Rooted Tree Game
Rooted Tree Game
Problem
Multiple rooted trees are given as the initial state. Alice and Bob, on the other hand, play the game. The game is played alternately by two players, with Alice on the play and Bob on the play. The player whose turn has turned takes the following actions.
- Select one root (vertex that has no parent). Let this vertex be S.
- Select the vertices contained in the rooted tree rooted at S (S can also be selected here). Let this vertex be T.
- Delete all vertices on the path from S to T, including S and T. It also deletes all edges where the deleted vertices are endpoints.
If all vertices have been deleted when the turn comes, that player loses.
When Alice and Bob always take the best action, determine which player will win against a given initial state.
The figure below shows an example of a player's actions. Example of player behavior
Constraints
The input satisfies the following constraints.
- 1 ≤ N ≤ 1000
- 0 ≤ M <N
- i <pi ≤ N (1 ≤ i ≤ M)
Input
The input is given in the following format.
N M p1 p2 :: pM
In the first line, the number of vertices N and the number of sides M in the initial state are given separated by blanks. At this time, the numbers representing each vertex are 1 to N. The next M line gives edge information. Of these, in line i, one integer pi is given. This means that there is an edge from vertex pi to vertex i. In other words, it means that the parent of vertex i is vertex pi.
Output
Print the name of the winning player (Alice or Bob) on one line.
Examples
Input
6 3 4 4 5
Output
Alice
Input
6 4 2 5 4 5
Output
Bob
inputFormat
input satisfies the following constraints.
- 1 ≤ N ≤ 1000
- 0 ≤ M <N
- i <pi ≤ N (1 ≤ i ≤ M)
Input
The input is given in the following format.
N M p1 p2 :: pM
In the first line, the number of vertices N and the number of sides M in the initial state are given separated by blanks. At this time, the numbers representing each vertex are 1 to N. The next M line gives edge information. Of these, in line i, one integer pi is given. This means that there is an edge from vertex pi to vertex i. In other words, it means that the parent of vertex i is vertex pi.
outputFormat
Output
Print the name of the winning player (Alice or Bob) on one line.
Examples
Input
6 3 4 4 5
Output
Alice
Input
6 4 2 5 4 5
Output
Bob
样例
6 3
4
4
5
Alice