X, N, M = gets.split.map(&:to_i) A = gets.split.map(&:to_i) B = gets.split.map(&:to_i) flg_a = A.include?(X) flg_b = B.include?(X) if flg_a && flg_b puts 'MrMaxValu' elsif flg_a puts 'MrMax' elsif flg_b puts 'MaxValu' else puts -1 end