Game
Time limit2sMemory limit512 MB
Players alternately append digits to a number; the player who first makes it reach or exceed n wins. Decide who wins under optimal play.
- Level
Medium6 of 10
- Topics
- Game theory, Greedy, Math, Implementation
- Solved
- No attempts yet
Statement
A disaster has struck the planet Shelezyaka: the supply of lubricant is running out. The government has therefore decided to hold a planet-wide competition, and the grand prize is a railcar full of lubricating materials.
The competition runs in several stages, and each stage is divided into many rounds. Two players take part in each round. The jury gives them a large integer . The players then take turns making moves. The first move of the first player consists of writing a single digit on a special board, and writing a zero as the first move is forbidden. After that, a move consists of appending an arbitrary digit to the right of the number already written. The player whose move makes the written number greater than or equal to wins.
The famous robot scientist <> believes that the outcome of the game is easy to predict. To prove it, he decided to produce a program that determines who wins when both players play optimally. Unfortunately, due to the shortage of lubricant, his manipulators have broken down, so he asks you for help.
Input
The first line of the input file contains an integer (). This number has no leading zeros.
Output
Print <<First>> if the first player wins under optimal play, and <<Second>> otherwise.