X, N, M = input().split() MrMax = input().split() MrValue = input().split() result = "-1" if X in MrMax and X in MrValue: result = "MrMaxValu" elif X in MrMax: result = "MrMax" elif X in MrValue: result = "MaxValu" print(result)