n = gets.chomp.to_i an = [""] * n ans = [] while i = gets s = i.chomp.split n.times{|i|an[i] += " "+s[i]} end n.times{|i|ans << an[i].split.count("nyanpass")} p ans.count(ans.max) > 1 ? -1 : ans.index(ans.max)+1