#include using namespace std; int main(){ int x,n,m; cin >> x >> n >> m; bool a = false, b = false; for(int i=0; i< n;i++){ int t; cin >> t; if(t == x){ a = true; break; } } for(int i=0; i< m;i++){ int t; cin >> t; if(t == x){ b = true; break; } } if(a&&b) cout << "MrMaxValu" << endl; else if(a) cout << "MrMax" << endl; else if(b) cout << "MaxValu" << endl; else cout << -1 << endl; return 0; }