Two piles
Limits: 2 sec., 256 MiB
This statement was translated automatically from Ukrainian.
Marichka and Zenyk are playing a game.
Each player has their own pile of stones. Initially, Marichka’s pile has \(a\) stones, and Zenyk’s pile has \(b\) stones.
The players take turns, with Marichka moving first.
A player during their turn can take any number of stones from their own pile or at most half of the stones from the opponent’s pile.
The loser is the one who cannot make a move.
Who wins under optimal play?
Input
The single line contains two integers \(a\) and \(b\) — the initial number of stones in Marichka’s and Zenyk’s piles, respectively.
Output
Print First if Marichka wins, or Second if
Zenyk wins.
Constraints
\(1 \le a, b \le 10^9\).
Samples
| Input (stdin) | Output (stdout) |
|---|---|
| 1 1 | Second |
| Input (stdin) | Output (stdout) |
|---|---|
| 3 2 | First |
Notes
In the first example, Zenyk wins. On her first turn, Marichka takes a stone from her pile, Zenyk takes from his and wins.
In the second example, Marichka wins.
Submit a solution
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|