N = int(input())
A = []

S = [0] * (N+1)
for i in range(N):
    A.append(int(input()))
    S[i+1] = S[i] + A[i]

for i in range(N):
    MAX = -float('inf')
    for j in range(N):
        if j == i:
            continue
        else:
            MAX = max(MAX, S[j+1] - S[j])
    print(MAX)