want = input().split()[0] mm = input().split() mv = input().split() if want in mm and want in mv: print("MrMaxValu") elif want in mm: print("MrMax") elif want in mv: print("MaxValu") else: print(-1)