<PREV Problem:
NEXT>
Solved by 1116 users: ...
UserDateAttemptTimeCMSC
xtender05 may 2010Perl2800.0615 
uru08 mar 2009Ruby500.0216 
xtender05 may 2010Perl1800.0616 
xtender05 may 2010Perl2000.0616 
xtender05 may 2010Perl2400.0616 
xtender05 may 2010Perl1700.0617 
V.A.KeRneL26 jan 2007Ruby400.0218 
V.A.KeRneL01 feb 2007Ruby500.0218 
sb3ar17 dec 2007Ruby800.0218 
sb3ar07 jan 2008Ruby1000.0218 
sb3ar23 dec 2007Ruby900.0219 
david_it2113 apr 2008Ruby400.0220 
V.A.KeRneL09 mar 2007Ruby700.0220 
barlukov14 dec 2009Kylix300.0122 
david_it2113 apr 2008Ruby300.0222 
sb3ar17 dec 2007Ruby600.0222 
sb3ar17 dec 2007Ruby700.0226 
V.A.KeRneL22 nov 2006Ruby100.0228 
V.A.KeRneL22 nov 2006Ruby200.0228 
uru08 mar 2009Ruby300.0228 
lacrosse14 apr 2013Ruby3100.0228 
Cthulhu21 apr 2006Ruby200.0230 
lacrosse14 apr 2013Ruby3000.0230 
borodiy_11113 dec 2011Python500.0731 
optimus27 aug 2009Ruby200.0232 
lacrosse14 apr 2013Ruby1800.0233 
lacrosse14 apr 2013Ruby2000.0233 
lacrosse14 apr 2013Ruby2600.0233 
Languages
C++
580
FPC
276
C
137
Java
54
Kylix
52
Python
19
Ruby
16
Perl
5
Lua
3
Scheme
2
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 

Nim Game -- who is the winner?

Time limit: 3 seconds.

You are to detect the status of the position in the Nim Game. There are stone piles: n1, n2, ... , nk. The ni gives the number of stones in the i-th pile. You are permited to take any quantity of stones from one pile for a move. Who takes the last stone(s) wins.

Input is the number of piles and piles sizes. k < 50, ni < 230.

Output is either "First wins." or "Second wins." without quots.

SAMPLE INPUT:
3
3 2 1
SAMPLE OUTPUT:
Second wins. 

SAMPLE INPUT:
3
5 2 1
SAMPLE OUTPUT:
First wins. 

Authors:
Voroztsov Artem

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


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

SW soft NIX
ID = 35.172.233.215