N=int(input())
count_list=[]
i=0
while(i<N):
    a=int(input())
    count_list.append(a)
    i+=1

i=0
while(i<N):
    b=[]
    for j in count_list:
        b.append(j)
    b[i]=0
    print(max(b))
    i+=1