t2x = [[]] n = gets.to_i de = (1..n).map { |x| (1..n).map { |x2| "0" } } (0..n-1).map { |t| gets.split(" ").each_with_index { |x2, i| de[t][i] = x2 } } res = (0..n-1).map { |i| al = 0 de.each_with_index { |l, e| if de[e][i] == 'nyanpass' then al += 1 end } [i, al] } tail = res.sort { |a, b| b[1] <=> a[1] } max = tail[0][1] len = tail.select { |xl| xl[1] == max }.length if max == 0 or len > 1 then puts "-1" else puts tail[0][0]+1 end