N = int(input()) A = [True] * N for i in range(N): for j, a in enumerate(input().split()): if i == j: continue if a != 'nyanpass': A[j] = False if A.count(True) != 1: print(-1) else: print(A.index(True)+1)