N=int(input())
x=[]
for i in range(N):
    x+=list(map(int,input().split()))    
for j in range(N):
    if j==N-1:
        print(max(x[0:N-1]))
    elif j==0:
        print(max(x[1:N]))
    else:
        print(max(max(x[0:j]),max(x[j+1:N])))
                                       