{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003ctitle\u003eProblem B: Bachet\u0027s Game\u003c/title\u003e\r\n\r\n\u003ch2\u003eProblem B: Bachet\u0027s Game\u003c/h2\u003e\r\n\r\n\u003cimg align\u003d\"right\" src\u003d\"http://uva.onlinejudge.org/external/104/p10404.jpg\"\u003e\r\n\r\nBachet\u0027s game is probably known to all but probably not by this name.\r\nInitially there are \u003cb\u003en\u003c/b\u003e stones on the table. There are two\r\nplayers Stan and Ollie, who move alternately. Stan always starts. The\r\nlegal moves consist in removing at least one but not more than\r\n\u003cb\u003ek\u003c/b\u003e stones from the table. The winner is the one to take the\r\nlast stone.\r\n\u003cp\u003e\r\nHere we consider a variation of this game. The number of stones\r\nthat can be removed in a single move must be a member of a certain\r\nset of \u003cb\u003em\u003c/b\u003e numbers. Among the \u003cb\u003em\u003c/b\u003e numbers there is\r\nalways 1 and thus the game never stalls.\r\n\r\n\u003ch3\u003eInput\u003c/h3\u003e\r\nThe input consists of a number of lines. Each line describes one game\r\nby a sequence of positive numbers. The first number is\r\n\u003cb\u003en\u003c/b\u003e \u0026lt;\u003d 1000000 the number of stones on the table; the second\r\nnumber is \u003cb\u003em\u003c/b\u003e \u0026lt;\u003d 10 giving the number of numbers that follow;\r\nthe last \u003cb\u003em\u003c/b\u003e numbers on the line specify how many stones\r\ncan be removed from the table in a single move.\r\n\r\n\u003ch3\u003eInput\u003c/h3\u003e\r\nFor each line of input, output one line saying either \u003ctt\u003eStan wins\u003c/tt\u003e\r\nor \u003ctt\u003eOllie wins\u003c/tt\u003e assuming that both of them play perfectly.\r\n\r\n\u003ch3\u003eSample input\u003c/h3\u003e\r\n\u003cpre\u003e20 3 1 3 8\r\n21 3 1 3 8\r\n22 3 1 3 8\r\n23 3 1 3 8\r\n1000000 10 1 23 38 11 7 5 4 8 3 13\r\n999996 10 1 23 38 11 7 5 4 8 3 13\r\n\u003c/pre\u003e\r\n\r\n\u003ch3\u003eOutput for sample input\u003c/h3\u003e\r\n\u003cpre\u003eStan wins\r\nStan wins\r\nOllie wins\r\nStan wins\r\nStan wins\r\nOllie wins\r\n\u003c/pre\u003e\r\n\u003chr\u003e\r\n\u003cb\u003eProblem Setter: Piotr Rudnicki\r\n\u003c/b\u003e"}}]}