def main(): apoi = [int(x) for x in input().split()] mrmax = [int(x) for x in input().split()] maxvalu = [int(x) for x in input().split()] if apoi[0] in (mrmax and maxvalu): print('MrMaxValu') elif apoi[0] in mrmax: print('MrMax') elif apoi[0] in maxvalu: print('MaxValu') else: print('-1') if __name__ == '__main__': main()