/*CODED BY mahmudulsakib2019
DATE:-12/03/2024;TIME:-01:57 am
BANGALDESH , SYLHET*/
#include <iostream>
#include <cmath> ///mathematics
#include<cstdlib> ///for std::exit(EXIT_SUCCESS)
#include <vector> ///array
#include <regex> ///searching_prefix_suffix
#include <algorithm> ///finding_max_min_from_array
#include <string> ///string_manipulation
#include <numeric> ///findin total sum of an array
using namespace std;
int main() {
int t;
cin >> t;
string ch;
cin >> ch;
if(ch[t-1]=='M'){
cout << "Mahfuz" << endl;
}
else if(ch[t-1]=='E'){
cout << "Emon" << endl;
}
else{
cout << "IDK" << endl;
}
return 0;
}