QOJ.ac

QOJ

حد الوقت: 1.0 s حد الذاكرة: 256 MB مجموع النقاط: 100 قابلة للهجوم ✓

#15218. The Painter

الإحصائيات

Alice and Bob are two painters who are coloring a tree. The tree is an undirected simple graph with $n$ nodes. Alice initially colors node $A$ black, and Bob initially colors node $B$ white.

Alice and Bob take turns coloring the tree, with Alice going first. In each turn, Alice can choose an uncolored node adjacent to a currently black node and color it black, or she can choose to rest. After Alice finishes her turn, Bob can choose an uncolored node adjacent to a currently white node and color it white, or he can choose to rest.

If both players want to color as many nodes as possible with their own color and play optimally, output the name of the player who colors more nodes. If Alice colors at least as many nodes as Bob, output "Alice"; otherwise, output "Bob".

Input

The first line contains three integers $n$, $A$, and $B$, representing the number of nodes in the tree, the index of the node initially colored by Alice, and the index of the node initially colored by Bob, respectively.

The next $n - 1$ lines each contain two integers $u$ and $v$, indicating that there is an edge between $u$ and $v$. It is guaranteed that the input is a tree.

Constraints: $2 \le n \le 10^5$, $1 \le u, v \le n$, $u \neq v$, $1 \le A, B \le n$, $A \neq B$.

Output

Output a single string. If Alice colors at least as many nodes as Bob, output "Alice"; otherwise, output "Bob".

Examples

Input 1

5 3 5
1 5
2 1
1 3
4 1

Output 1

Alice

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.