All submissions for this problem are available.
Zach and Cody are playing a game. There are initially N chips on a table. Zach starts the game making the first move. In each turn one has to choose a move from a set of moves. The set of moves consists of all the moves of removing pk chips from the table, where p is any prime and k is any non negative integer. The winner is the one to take the last chip. Can you decide who will win the game, assuming both the players follow a perfect strategy? If Zach wins, what will be the smallest possible number that he can remove in his first move?
An integer T, denoting the number of test cases.
Each test case contains one integer N, the number of chips on the table.
Print "Zach" if Zach wins or "Cody" if Cody wins. Print the output for each test case on a new line (without quotes).
1 <= T <= 100000
1 <= N <= 100000
|Time Limit:||0.137615 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.5, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.