/*** author: yuji9511 ***/ #include using namespace std; using ll = long long; using lpair = pair; const ll MOD = 1e9+7; const ll INF = 1e18; #define rep(i,m,n) for(ll i=(m);i<(n);i++) #define rrep(i,m,n) for(ll i=(m);i>=(n);i--) #define printa(x,n) for(ll i=0;i void print(H&& h, T&&... t){cout<(t)...);} int main(){ cin.tie(0); ios::sync_with_stdio(false); ll X,N,M; cin >> X >> N >> M; ll A[100010], B[100010]; rep(i,0,N) cin >> A[i]; rep(i,0,M) cin >> B[i]; map ma,mb; rep(i,0,N) ma[A[i]]++; rep(i,0,M) mb[B[i]]++; if(ma[X] > 0 && mb[X] > 0){ print("MrMaxValu"); }else if(ma[X] > 0){ print("MrMax"); }else if(mb[X] > 0){ print("MaxValu"); }else{ print("-1"); } }