import math
import copy
def py():
    print("Yes")
def pn():
    print("No")
def iin():
    x = int(input())
    return x

neko = 0
nuko = 10

a = []
n = iin()
for i in range(n):
    a.append(iin())
for i in range(n):
    b = copy.copy(a)
    b.pop(i)
    print(max(b))