x,*y = gets.split.map(&:to_i) a,b = 2.times.map{gets.split.map(&:to_i).include? x} case when a && b puts 'MrMaxValu' when a puts 'MrMax' when b puts 'MaxValu' else puts -1 end