N = input() ren = set() for i in range(N): greeting = raw_input().split() for j,greet in enumerate(greeting): if (greet == "nyanpass"): ren.add(j + 1) if (len(ren) == 1): print ren.pop() else: print -1