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