x, _n, _m = gets.split.map(&:to_i) a = gets.split.map(&:to_i) b = gets.split.map(&:to_i) cond1 = a.member?(x) cond2 = b.member?(x) if cond1 && !cond2 puts :MrMax elsif !cond1 && cond2 puts :MaxValu elsif cond1 && cond2 puts :MrMaxValu else puts -1 end