X, N, M = map(int, input().split()) A = list(map(int, input().split())) B = list(map(int, input().split())) MrMax = X in A MaxValu = X in B if MrMax and not MaxValu: print('MrMax') elif not MrMax and MaxValu: print('MaxValu') elif MrMax and MaxValu: print('MrMaxValu') else: print(-1)