Given a pile of sticks, determine which player wins under the game's fixed move rule.
A Game With Sticks
gfgGame With Sticks
Two players play a turn-based game starting with n sticks.
On each move, a player takes a fixed number of sticks according to the game rules. The players alternate turns, and the player who cannot make a legal move loses.
Your task is to determine whether the first player or the second player wins for the given starting number of sticks.
This is a small logic problem: identify the pattern in the winning positions and output the winner accordingly.
Input Format
- A single integer
nrepresenting the initial number of sticks.
Output Format
- Print the name of the winning player, typically
FirstorSecond, according to the game rules.
Constraints
1 <= nis a positive integer.- Solve using the observed game pattern rather than exhaustive search.
Example 1
Input
1
Output
First
Explanation
With one stick, the first player can make the only legal move and win.
Example 2
Input
2
Output
Second
Explanation
The position is losing for the first player under the move rule, so the second player wins.
Premium problem context
Unlock deeper context for this problem
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.