n=int(input())
l=[]
for i in range(n):
    l.append(int(input()))
for i in range(n):
    tmp=0
    b=[False for x in range(n)]
    b[i]=True
    for j in range(n):
        if(b[j]==False and l[j]>tmp):
            tmp=l[j]
    print(tmp)

