v = Array.new(gets.to_i, 0) while l=gets l.chomp.split.each_with_index do |g,i| v[i] += 1 if g == "nyanpass" end end if v.count {|i| i == v.length - 1 } == 1 puts v.index(v.length - 1) + 1 else puts -1 end