import numpy as np
n = int(input())
nplst=np.array([])
for i in range(n):
  a=int(input())
  nplst=np.append(nplst,a)
np2=np.zeros(n).reshape(n,1)
np3=nplst+np2
np3=np3-np.diag(nplst)
for i in range(n):
  print(int(np.max(np3[i])))