X,N,M = input().split() A = input().split() B = input().split() S = 'Mr'*(X in A) + 'Max' + 'Valu'*(X in B) print('-1' if S == 'Max' else S)