X = input().split()[0] L1 = input().split() L2 = input().split() s = 'Mr'*(X in L1) + 'Max' + 'Value'*(X in L2) print('-1' if s == 'Max' else s)