Spy Jenga
Time limit2sMemory limit1024 MB
Given a Jenga tower of n levels, decide who wins when Johnny moves first and the player whose move topples the tower loses.
- Level
Medium6 of 10
- Topics
- Game theory, Math
- Solved
- No attempts yet
Problem
To impress Lorna Campbell, Johnny English decides to beat her at spy Jenga.
Jenga is a tall tower of wooden blocks. Each level has three identical rectangular blocks laid side by side to form a square. The top level has blocks running across, the level below runs along, the next runs across again, and so on.
In spy Jenga, the players take turns removing one block from a level. Blocks in the top and bottom levels cannot be removed. A removed block is set aside and never put back into the tower. The tower falls if two adjacent blocks are removed. Assume the tower never falls from a careless move, since both players are true professionals. The player who makes the move that causes the tower to fall loses.
Johnny faces a tower of n levels against a very clever opponent who does not want to give up. Determine who wins if Johnny moves first.

Input
A single line contains a positive integer n, the height of the tower ().
Output
Print Johnny if Johnny wins. Otherwise, print Lorna.