N = int(input()) A = [int(i) for i in input().split()] while len(A) > 1: for j in range(1,N): A.append(A[j-1]+A[j]) del A[0:N] N-=1 print(*A)