This page is still under construction.

Parts of this page are still being built. What you see may change.

Card Game

Time limit1sMemory limit128 MB

Summary
Two players alternately pick cards and OR the value into a shared number, losing by completing 511 or moving with no cards left.
Level

Medium7 of 10

Topics
Game theory, Bit manipulation
Solved
No attempts yet

Problem

Myungwoo and Hongjun are playing a card game. They use NN cards, each showing a number from 0 to 511, and one sheet of paper. At the start the paper has 0 written on it.

Myungwoo goes first and the two take turns. On your turn you freely pick one of the remaining cards. If the picked card shows xx and the paper shows yy, erase the number on the paper and write the bitwise OR of the two numbers, xOR⁡yx \operatorname{OR} y. You lose the game if your turn starts with no cards left, or if the number you just wrote is 511.

Both players know the optimal strategy for this game and play it. Given the cards, decide who wins.

Input

The first line has the initial number of cards NN (1≤N≤501 \le N \le 50).

The second line has NN non-negative integers separated by spaces, the numbers written on the cards. Each number written on a card is smaller than 512.

Output

Print myungwoo if Myungwoo wins, or hongjun if Hongjun wins.

Hint

If the paper shows 510 and every remaining card is odd, the player to move writes 511 whichever card they pick, so that player loses.

Examples2

  1. Example 1

    Input
    5
    3 5 7 9 510
    
    Expected output
    myungwoo
  2. Example 2

    Input
    1
    511
    
    Expected output
    hongjun