#include <cstdlib>
#include <vector>
using namespace std;
vector<int> tree[100000];
int n, m;
int val[100000];
int dfs(int id){
if(val[id] != -1) return val[id];
if(id == n) return 1;
for(int lx = 0;lx < tree[id].size();lx++)
if(dfs(tree[id][lx]))
return val[id] = 0;
return val[id] = 1;
}
int main(){
for(;;){
scanf("%d %d", &n, &m);
if(n == 0 and m == 0) break;
for(int lx = 0;lx < n;lx++)
tree[lx].clear(), val[lx] = -1;
for(int lx = 0;lx < m;lx++){
int a, b; scanf("%d %d", &a, &b);
tree[a-1].push_back(b-1);
}
char tmp[20];
scanf("%s", tmp);
puts((dfs(0)^(tmp[1]=='i')) ? "Moumou":"Mimi");
}
return 0;
}
沒有留言:
張貼留言