using System; using System.Collections.Generic; using System.Linq; using System.IO; using System.Threading; using static util; class Program { static void Main(string[] args) { var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false }; var solver = new Solver(sw); // var t = new Thread(solver.solve, 1 << 26); // 64 MB // t.Start(); // t.Join(); solver.solve(); sw.Flush(); } } class Solver { StreamWriter sw; // Scan sc; void Prt(string a) => sw.WriteLine(a); void Prt(IEnumerable a) => Prt(string.Join(" ", a)); void Prt(params object[] a) => Prt(string.Join(" ", a)); public Solver(StreamWriter sw) { this.sw = sw; // this.sc = new Scan(); } public void solve() { var (x, n, m) = new Func<(int, int, int)>(() => { var _ = Console.ReadLine().Split().Select(int.Parse).ToArray(); return (_[0], _[1], _[2]); })(); Assert(1 <= x, x <= 100000); Assert(1 <= n, n <= 100000); Assert(1 <= m, m <= 100000); var a = Console.ReadLine().Split().Select(int.Parse).ToArray(); var b = Console.ReadLine().Split().Select(int.Parse).ToArray(); Assert(a.Length == n); Assert(b.Length == m); Assert(1 <= a.Min(), a.Max() <= 100000); Assert(1 <= b.Min(), b.Max() <= 100000); if (a.Contains(x) && b.Contains(x)) { Prt("MrMaxValu"); } else if (a.Contains(x)) { Prt("MrMax"); } else if (b.Contains(x)) { Prt("MaxValu"); } else { Prt("-1"); } } } static class util { public static void Assert(params bool[] conds) { foreach (var cond in conds) if (!cond) throw new Exception(); } }