import copy
# 入力                                                                          
N = int(input())

num_list = []
for i in range(N):
    num_list.append(int(input()))

for i in range(N):
    target = copy.copy(num_list)
    del target[i]
    print(max(target))