Codeforces Round 184 (Div. 2) |
---|
Finished |
Two people play the following string game. Initially the players have got some string s. The players move in turns, the player who cannot make a move loses.
Before the game began, the string is written on a piece of paper, one letter per cell.
A player's move is the sequence of actions:
Your task is to determine the winner provided that both players play optimally well. If the first player wins, find the position of character that is optimal to cut in his first move. If there are multiple positions, print the minimal possible one.
The first line contains string s (1 ≤ |s| ≤ 5000). It is guaranteed that string s only contains lowercase English letters.
If the second player wins, print in the single line "Second" (without the quotes). Otherwise, print in the first line "First" (without the quotes), and in the second line print the minimal possible winning move — integer i (1 ≤ i ≤ |s|).
abacaba
First
2
abcde
Second
In the first sample the first player has multiple winning moves. But the minimum one is to cut the character in position 2.
In the second sample the first player has no available moves.
Name |
---|