x,n,m = map(int,input().split()) k = 0 ls = list(map(int,input().split())) if x in ls: k += 1 ls = list(map(int,input().split())) if x in ls: k += 2 print(["-1","MrMax","MaxValue","MrMaxValue"][k])