N = int(input())
l = []
for i in range(N):
    a = int(input())
    l.append(a)
 
cnt = 0
cnt2 = 0
for i in range(len(l)):
    nl = l
    cnt2 += nl[cnt]
    nl[cnt] = 0
    print(max(nl))
    nl[cnt] = cnt2
    cnt2 = 0
    cnt += 1