N = int(input()) L = list(range(N)) for _ in range(N): a = input().split() L = [i for i in L if a[i] == "nyanpass" or a[i] == "-"] print(L[0] + 1 if len(L) == 1 else -1)