class Calc0239 def initialize(args) args = args.map { |l| l.chomp.split(/\s+/) } @n = args.shift.first.to_i @as = args.transpose end def run rens = [] @as.each_with_index do |r, i| rens << i + 1 if (r - ['-']).all? { |a| a == 'nyanpass' } end if rens.empty? || rens.size >= 2 -1 else rens.first end end end puts Calc0239.new(STDIN.readlines).run if __FILE__ == $0