N = int(input()) Rng = range(N) nyanpass = [0] * N for i in Rng: A = list(input().split()) for j in Rng: if A[j] == 'nyanpass': nyanpass[j] += 1 cnt = 0 for j in Rng: if nyanpass[j] == N - 1: cnt += 1 ans = (j + 1) if cnt > 1: break if cnt == 1: print(ans) else: print(-1)