X,N,M = map(int,input().split()) A = list(map(int,input().split())) B = list(map(int,input().split())) s = set(A) d = set(B) if X in A and X in B: ans = 'MrMaxValue' elif X in A: ans = 'MrMax' elif X in B: ans = 'MaxValue' else: ans = -1 print(ans)