Josh is bored of playing Nim, so he has decided to make his own variant! He will play against Mike, with the following rules:
There are
- The current player should select a pile
which contains at least one stone. If no such pile exists, then the current player immediately loses and their opponent wins. - Then, their opponent will remove any positive integer number of stones from pile
of their choosing. Of course, they cannot remove more stones from pile than there are currently.
If both Josh and Mike play optimally, who will win? You are to answer this question for
Constraints
The sum of
Subtask 1 [20%]
Subtask 2 [20%]
Subtask 3 [60%]
No additional constraints.
Input Specification
The first line contains a single integer,
The first line of each pair contains a single integer,
The second line of each pair contains
Output Specification
Output Josh
if Josh will win, and Mike
if Mike will win.
Sample Input
2
1
2
2
1 2
Sample Output
Mike
Josh
Explanation
In the first game, Josh has no choice but to choose pile
In the second game, Josh can begin by choosing pile
Comments