import numpy as np

N = int(input())
a_list = list(map(int, input().split()))

i_sum_list = []
zero_cnt = 0
for i in range(2, N + 1):
    if i == 2:
        for j in range(0, N - i + 1):
            if j < N - i:
                i_sum_list.append(sum(a_list[j:j + i]))

            if j == N - i:
                i_sum_list.append(sum(a_list[j:]))

        zero_cnt += sum(x == 0 for x in i_sum_list)
        i_sum_list = np.array(i_sum_list)
        a_list = np.array(a_list)
    else:
        i_sum_list = i_sum_list[:-1] + a_list[i-1:]

        zero_cnt += sum(x == 0 for x in i_sum_list) 

print(i_sum_list)


