{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003chtml\u003e\n \u003chead\u003e\u003c/head\u003e\n \u003cbody\u003e\n \u003cdiv id\u003d\"problem-body\"\u003e \n \u003c!--Converted with LaTeX2HTML 96.1 (Feb 5, 1996) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds --\u003e \n \u003ctitle\u003eA Game of Moving Pebbles\u003c/title\u003e \n \u003ch2\u003e\u003cfont color\u003d\"#0070E8\"\u003e\u003ca name\u003d\"SECTION0001002000000000000000\" href\u003d\"\"\u003eProblem\u003c/a\u003e\u003c/font\u003e\u003c/h2\u003e \n \u003cp\u003eTwo players play the following game. At the beginning of the game they start with \u003cb\u003en\u003c/b\u003e (1\u0026lt;\u003d\u003cb\u003en\u003c/b\u003e\u0026lt;\u003d100000) piles of stones. At each step of the game, the player chooses a pile and remove at least one stone from this pile and move zero or more stones from this pile to any other pile that still has stones. A player loses if he has no more possible moves. Given the initial piles, determine who wins: the first player, or the second player, if both play perfectly. \u003c/p\u003e \n \u003cp\u003e \u003c/p\u003e \n \u003ch2\u003e\u003cfont color\u003d\"#0070E8\"\u003e\u003ca name\u003d\"SECTION0001003000000000000000\" href\u003d\"\"\u003eThe Input\u003c/a\u003e\u003c/font\u003e\u003c/h2\u003e \n \u003cp\u003e Each line of input has integers \u003cb\u003e0 \u0026lt; n \u0026lt;\u003d 100000\u003c/b\u003e, followed by \u003cb\u003en\u003c/b\u003e positive integers denoting the initial piles. \u003c/p\u003e \n \u003ch2\u003e\u003cfont color\u003d\"#0070E8\"\u003e\u003ca name\u003d\"SECTION0001004000000000000000\" href\u003d\"\"\u003eThe Output\u003c/a\u003e\u003c/font\u003e\u003c/h2\u003e \n \u003cp\u003e For each line of input, output \"first player\" if first player can force a win, or \"second player\", if the second player can force a win. \u003c/p\u003e \n \u003ch2\u003e\u003cfont color\u003d\"#0070E8\"\u003e\u003ca name\u003d\"SECTION0001005000000000000000\" href\u003d\"\"\u003eSample Input\u003c/a\u003e\u003c/font\u003e\u003c/h2\u003e \n \u003cp\u003e \u003c/p\u003e \n \u003cpre\u003e\r\n3 2 1 3\r\n\u003c/pre\u003e \n \u003cp\u003e \u003c/p\u003e \n \u003ch2\u003e\u003cfont color\u003d\"#0070E8\"\u003e\u003ca name\u003d\"SECTION0001006000000000000000\" href\u003d\"\"\u003eSample Output\u003c/a\u003e\u003c/font\u003e\u003c/h2\u003e \n \u003cp\u003e \u003c/p\u003e \n \u003cpre\u003e\r\nfirst player\r\n\u003c/pre\u003e \n \u003c/div\u003e\n \u003c/body\u003e\n\u003c/html\u003e"}}]}