let n = readLine()!.split(separator:" ").map{Int($0)!}[0] let a = readLine()!.split(separator:" ").map{Int($0)!} let b = readLine()!.split(separator:" ").map{Int($0)!} var v = 0 v += a.contains(n) ? 1 : 0 v += b.contains(n) ? 2 : 0 print([-1,"MrMax","MaxValu","MrMaxValu"][v])