x,n,m = map(int, input().split()) a = set(list(map(int, input().split()))) b = set(list(map(int, input().split()))) if x not in a|b: print(-1) else: print('Mr'*(x in a) + 'Max' + 'Valu'*(x in b))