# Read the first line input X, N, M = map(int, input().split()) # Read the list for MrMax and convert to a set A = set(map(int, input().split())) # Read the list for MaxValu and convert to a set B = set(map(int, input().split())) # Check presence in each set in_mr_max = X in A in_max_val = X in B # Determine and print the result if in_mr_max and in_max_val: print("MrMaxValu") elif in_mr_max: print("MrMax") elif in_max_val: print("MaxValu") else: print(-1)