#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
void solve(int cs) {
int n, m;
cin >> m >> n;
vector<vector<int>> M(7, vector<int>(m)), N(7, vector<int>(n));
for (int i = 0; i < 7; i++) {
for (int j = 0; j < m; j++) {
cin >> M[i][j];
}
}
for (int i = 0; i < 7; i++) {
for (int j = 0; j < n; j++) {
cin >> N[i][j];
}
}
int mahfuz = 0, noyon = 0;
int cnt = 0;
for (int j = 0; j < m; j++) {
for (int i = 0; i < 7; i++) {
if (M[i][j] > 0) cnt += M[i][j];
else {
mahfuz = max(mahfuz, cnt);
cnt = 0;
}
}
}
mahfuz = max(mahfuz, cnt);
cnt = 0;
for (int j = 0; j < n; j++) {
for (int i = 0; i < 7; i++) {
if (N[i][j] > 0) cnt += N[i][j];
else {
noyon = max(noyon, cnt);
cnt = 0;
}
}
}
noyon = max(noyon, cnt);
if (mahfuz > noyon) cout << "Mahfuz is the boss\n";
else if (noyon > mahfuz) cout << "Nayon is the boss\n";
else cout << "No one is the boss\n";
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int tc = 1;
// cin >> tc;
for (int cs = 1; cs <= tc; cs++) {
solve(cs);
}
return 0;
}