import strutils, sequtils, algorithm proc input: auto = stdin.readLine let N = input().parseInt var grt = newSeqWith(N, "") cnt = newSeqWith(N, 0) for i in 0 ..< N: let A = input().split for j, a in A: grt[j] &= a if i != A.high: grt[j] &= ", " for i, v in grt: cnt[i] = v.count("nyanpass") if cnt.count(N - 1) == 1: echo cnt.find(N - 1) + 1 else: echo -1