rentyon = "nyanpass" N = int(input()) Amat = [ input().split() for i in range(N) ] res = [True]*N for row in Amat: for i, a in enumerate(row): if rentyon != a and a != "-": res[i] = False if sum(res) == 1: for i, r in enumerate(res, start=1): if r: print(i) else: print(-1)