f=lambda:map(int,input().split()) x,n,m=f() a=f() b=f() ans=['MrMax','MaxValu','MrMaxValu',-1] print(ans[2] if x in a and x in b else ans[0] if x in a else ans[1] if x in b else a[3])