#include using namespace std; typedef long long int ll; typedef pair P; typedef vector VI; typedef vector VVI; const ll MOD = 1000000007; const ll INF = 2147483647; const ll LINF = 9223372036854775807; #define REP(i, n) for(int i = 0; i < n; i++) #define ALL(v) v.begin(), v.end() int main() { int x, n, m; cin >> x >> n >> m; bool f1 = 0, f2 = 0; int a; REP(i, n) { cin >> a; if (a == x)f1 = 1; } REP(i, m) { cin >> a; if (a == x)f2 = 1; } if (f1 && f2)cout << "MrMaxValu" << endl; else if (f1) cout << "MrMax" << endl; else if(f2)cout << "MaxValu" << endl; else cout << -1 << endl; return 0; }