<PREV Problem:
NEXT>
Solved by 420 users: ...
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 

Stone Game -- who is the winner?

Time limit = 5

You are to determine the status of a position in Stone Game, that has the following rules.

There are k stone piles with n1, n2, ... , nk stones. One is permitted to take 2m stones from one pile for a move. The one who takes the last stone(s) wins.

Input contains the number of piles and their sizes delimited with spaces or/and newline symbols. k < 50, ni < 10200.

Output either the string "First wins." or the string "Second wins." (without quotes).

Input#1
3
3 2 1
Output#1
First wins. 
Input#2
5
111 
777 
777 
9999999999
9999999999
Output#2
Second wins.

Author:
Well-known problem. Added by Voroztsov Artem.

<PREV | Problem set | Search related messages | NEXT>


© acm.mipt DevGroup
The page was generated in 210ms

SW soft NIX
ID = 54.81.197.127