Clash of programmers

Clash of programmers

Time Limit: 1.0 s

Memory Limit: 256.0 MB

Description

  • Mahfuz and Emon is planning to play a card game for leisure time. Sometimes Emon is very busy, otherwise they play the game. The rules are very simple :
  1. If a player wins a round, gets a point.
  2. If a player has won a set of rounds his points doubles.
  3. If a player gets atleast k point, the player wins the game. Game is ended as soon as a player reaches k points.

But heres the twist, as they both are hard core competitive programmer, Mahfuz and Emon changes rules for winning a round and winning a set in random manner, it is very hardly encrypted.In other words they can change the value K any time in the game.

You are given an integer \(N\) (number of rounds played) followed by a string containing only three type of characters 'M','E' and '?. 'M' means Mahfuz won the round; 'E' means Emon won the round and '?' means the winner is unknow.

Your task is to find the possible winner of the game.

Format

Input

first line takes an integer \(N\) : number of rounds
second line takes a string \(S\) : which represents N rounds

Output

print "Mahfuz" (without quote) if mahfuz is the winner, Print "Emon" if emon is the winner else print "IDK" .

Sample 1

input

5
EEMMM

output

Mahfuz

Sample 2

input

6
MEMEEE

output

Emon

Sample 3

input

6
MM?EE?

output

IDK

Information

ID
1031
Difficulty
8
Category
Beginners Click to Show
Tags
(None)
# Submissions
52
Accepted
6
Accepted Ratio
12%
Uploaded By

Related

In following contests:

Brain booster #2