Weasley Wizard Wheezes
All submissions for this problem are available.
Luna Lovegood, Neville Longbottom, Cho Chang, Colin Creevey and Lee Jordan of the Dumbledore's Army are in the queue for a "Bertie Bott's Every Flavour Beans" in a magical room in Fred and George's "Weasleys' Wizard Wheezes" and there are no other people in the queue. The first one in the queue, Luna eats a bean and her doppelganger appears out of no where! The resulting two Lunas go to the end of the queue. Then the next in the queue, Neville eats a bean and gets to the end of the queue as two Nevilles, and so on. This process goes on and on. When they all get bored of eating beans, they cast a spell and all the doppelgangers disappear.
Your task is to find the person who will eat the n-th bean.
In the beginning the sequence in which they stand in the queue is: Luna, Neville, Cho, Colin, Lee.
The first line of the input contains t, the number of test cases.
Then t lines follow, each containing a single integer n.
Print the single line — the name of the person who will eat the n-th Bertie Bott's Every Flavour Bean. The beans are numbered starting from 1.
Output the names as: "Luna Lovegood" or "Neville Longbottom" or "Cho Chang" or "Colin Creevey" or "Lee Jordan" (without the quotes).
1 <= t <= 100
1 <= n <= 109
Input: 2 1 8 Output: Luna Lovegood Neville Longbottom
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.5, PYPY, 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, SCM chicken, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.