import sys input = sys.stdin.buffer.readline X, N, M = map(int, input().split()) As = list(map(int, input().split())) Bs = list(map(int, input().split())) mrmax = X in As maxvalu = X in Bs if not mrmax and not maxvalu: print('-1') else: print(('Mr' if mrmax else '') + 'Max' + ('Valu' if maxvalu else ''))