#P12530. [XJTUPC 2025] 公道杯

[XJTUPC 2025] 公道杯

Description

Alice and Bob are playing a game with nn Pythagorean cups (known as Fairness cups in Chinese). When drinking from a Pythagorean cup, it behaves like a regular cup as long as it is not filled to the top. If it is filled to the top, the liquid will completely flow out through the bottom hole. The structure of the Pythagorean cup is shown in the figure below.

Pythagorean Cup (Fairness Cup)

In the initial phase, wine is poured into the nn empty Pythagorean cups in sequence. There are three possible amounts of wine that can be poured: no wine, represented by the uppercase letter E\tt{E}; half a cup of wine, represented by the uppercase letter H\tt{H}; and a full cup of wine, represented by the uppercase letter F\tt{F}.

Then, each time Alice and Bob can choose a non-empty\textbf{non-empty} Pythagorean cup and pour all the wine from it into the cup to its right. If they choose the rightmost cup, they can simply discard it.

At any moment, if a Pythagorean cup is full, it will immediately flow out and become empty. If a cup is half full and half a cup of wine is poured into it, it will overflow and become empty.

Alice and Bob take turns making moves, with Alice going first. If Alice or Bob has no Pythagorean cups to choose from, the person who cannot choose Pythagorean cups loses the game. Assuming both Alice and Bob play optimally, determine who wins the game.

Input Format

The input consists of a single line containing a string SS (1S1061\le |S|\le 10^6). The length of the string S|S| represents the number of Pythagorean cups nn.

SiS_i is one of the uppercase letters EHF\tt{EHF}, indicating how much wine to pour into the ii-th Pythagorean cup initially. No wine is represented by the uppercase letter E\tt{E}; half a cup of wine is represented by the uppercase letter H\tt{H}; and a full cup of wine is represented by the uppercase letter F\tt{F}.

Output Format

Output a single line containing a string.

If Alice wins, output Alice\tt{Alice}; if Bob wins, output Bob\tt{Bob}.

HEFH
Alice
HEHEFHEHFE
Bob

Hint

For the first sample: Initially, half a cup of wine is poured into the 11-st Pythagorean cup; no wine is poured into the 22-nd cup; a full cup of wine is poured into the 33-rd cup, which immediately flows out; half a cup of wine is poured into the 44-th cup. After the start, the states of the 44 cups are half full, empty, empty, and half full.

At the beginning, Alice can choose the 44-th cup and discard it; then, only the 11-st cup is half full, and Bob can only choose the 11-st cup to pour into the 22-nd cup; similarly, at this point, only the 22-nd cup is half full, and Alice can only choose the 22-nd cup to pour into the 33-rd cup; Bob can only choose the 33-rd cup to pour into the 44-th cup; Alice can only choose the 44-th cup and discard it. At this point, Bob cannot choose any Pythagorean cup anymore and loses the game.