There are n integers b_1, b_2, ..., b_{n} written in a row. For all i from 1 to n, values a_{i} are defined by the crows performing the following procedure:

  The crow sets a_{i} initially 0.  The crow then adds b_{i} to a_{i}, subtracts b_{i} + 1, adds the b_{i} + 2 number, and so on until the n'th number. Thus, a_{i} = b_{i} - b_{i} + 1 + b_{i} + 2 - b_{i} + 3.... 

Memory gives you the values a_1, a_2, ..., a_{n}, and he now wants you to find the initial numbers b_1, b_2, ..., b_{n} written in the row? Can you do it?


-----Input-----

The first line of the input contains a single integer n (2 ≤ n ≤ 100 000) — the number of integers written in the row.

The next line contains n, the i'th of which is a_{i} ( - 10^9 ≤ a_{i} ≤ 10^9) — the value of the i'th number.


-----Output-----

Print n integers corresponding to the sequence b_1, b_2, ..., b_{n}. It's guaranteed that the answer is unique and fits in 32-bit integer type.


-----Examples-----
Input
5
6 -4 8 -2 3

Output
2 4 6 1 3 

Input
5
3 -2 -1 5 6

Output
1 -3 4 11 6 



-----Note-----

In the first sample test, the crows report the numbers 6, - 4, 8, - 2, and 3 when he starts at indices 1, 2, 3, 4 and 5 respectively. It is easy to check that the sequence 2 4 6 1 3 satisfies the reports. For example, 6 = 2 - 4 + 6 - 1 + 3, and  - 4 = 4 - 6 + 1 - 3.

In the second sample test, the sequence 1,  - 3, 4, 11, 6 satisfies the reports. For example, 5 = 11 - 6 and 6 = 6.

Difficulty: interview

Starter code:

Solutions:
def main():
    n = int(input())
    arr = list(map(int, input().split()))
    arr.append(0)
    ans = []
    for i in range(n):
        ans.append(arr[i] + arr[i + 1])
    print(*ans)
    
main()

n = int(input())
l = list(map(int,input().split()))
a = []
a += [l[-1]]
for i in range(n-1,0,-1):
    a += [l[i] + l[i-1]]
a = a[::-1]
print(' '.join(list(map(str,a))))

n = int(input())
ai = list(map(int,input().split()))
bi = [0]*n
bi[n-1] = ai[n-1]
for i in range(n-2,-1,-1):
    bi[i] = ai[i] + ai[i+1]
for i in range(n):
    print(bi[i],end=" ")


n = int(input())
arr = list(map(int, input().split()))
for i in range(n - 1):
    print(arr[i] + arr[i + 1], end = ' ')
print(arr[i + 1])

n = int(input())
a = list(map(int, input().split()))
ans = [0] * n
for i in range(n - 1, -1, -1):
    if i == n - 1:
        ans[i] = a[i]
    else:
        ans[i] = a[i] + a[i + 1]
for i in ans:
    print(i, end = " ")

n = int(input())
b = list(map(int, input().split()))
b.append(0)
a = map(lambda x, y: str(x+y), b, b[1:])
print(" ".join(a))

3

n = int(input())
a = list(map(int, input().split()))
a.append(0)
b = [a[i] + a[i + 1] for i in range(n)]
print(" ".join(map(str, b)))


n = int(input())
a = list(map(int, input().split()))
b = []
for i in range(n-1):
    b.append(a[i]+a[i+1])
b.append(a[n-1])
for i in b:
    print(i, end = ' ')

# You lost the game.
n = int(input())
L = list(map(int, input().split()))
R = [0 for _ in range(n)]
R[n-1] = L[n-1]
t = L[n-1]
for i in range(n-2,-1,-1):
    if 1:
        R[i] = L[i]+t
        t = R[i]-t
for i in range(n):
    print(R[i],end=" ")


n = int(input())
a = list(map(int,input().split()))
b = []
for i in range(n-1):
	b.append(a[i]+a[i+1])
b.append(a[n-1])
print(*b)

n = int(input())
s = input()
b = s.split()
for i in range(0, n):
    b[i] = int(b[i])
a = [0] * n
for i in range(0, n - 1):
    a[i] = str(b[i] + b[i + 1])
a[n - 1] = str(b[n - 1])
print(" ".join(a))


import sys

fin = sys.stdin
fout = sys.stdout
n = int(fin.readline())
a = list(map(int, fin.readline().split()))
res = [a[-1]]
for i in range(n - 2, -1, -1):
    res.append(a[i + 1] + a[i])
res.reverse()
fout.write(' '.join(map(str, res)))


n = int(input())
a = list(map(int, input().split()))
b = [0] * n
b[n-1] = a[n -1]

for i in range(n - 2, -1, -1):
    b[i] = a[i] + a[i + 1]

print(*b)


n=int(input())
lis=list(map(int,input().split()))
lis2=[]
for i in range(0,len(lis)-1):
    lis2.append(lis[i]+lis[i+1])
lis2.append(lis[len(lis)-1])
for i in lis2:
    print(i,end=' ')

n = int(input())
arr = list(map(int, input().split()))
arr.reverse()
res = []
s = 0
for i in arr:
    res.append(i-s)
    s += res[-1]
    s *= -1
print(' '.join(map(str, reversed(res))))

n=int(input())
v=[int(i) for i in input().split()]
b=[v[i]+v[i+1] for i in range(n-1)]
b.append(v[-1])
for i in range(n):
    print(b[i],end=" ")


n = int(input())
A = list(map(int, input().split()))
answer = [0] * n
for i in range(len(A) - 1, - 1, -1):
    if i == len(A) - 1:
        answer[i] = A[i]
    else:
        answer[i] = (A[i] + A[i + 1])
print( ' '.join(map(str, answer)))


n = int(input())
a = list(map(int, input().split()))
a.append(0)
for i in range(n):
    print(a[i] + a[i+1], end=' ')


n = int(input())
arr = list(map(int, input().split()))
for i in range(0, n - 1):
    print(arr[i] + arr[i + 1], end=" ")
print(arr[n - 1])


n=int(input())
a=input().split()
for i in range (n):
    a[i]=int(a[i])
a.reverse()
b=[]
b.append(a[0])
for i in range (n-1):
    b.append(a[i]+a[i+1])
b.reverse()
print(" ".join(map(str, b)))


n = int(input())
A = list(map(int,input().split()))
L = []
L.append(A[n-1])
cnt = 0
for i in range(n):
    r = A[n-i-1] + A[n-i-2]
    cnt+=1
    if cnt == n:
        break
    # print(r)
    L.append(r)
L.reverse()

print(*L)

n = int(input())

a = list(map(int, input().split()))

b = []
for i in range(n - 1):
    b.append(a[i] + a[i+1])
b.append(a[n -1 ])
print(" ".join(map(str, b)))



input()
a = list(map(int, input().split()))

diff_sum = 0
b = []

for i, ai in enumerate(a[::-1]):
    bi = ai - (1 if i % 2 == 0 else -1) * diff_sum
    diff_sum += (1 if i % 2 == 0 else -1) * bi
    b.append(bi)

print(" ".join(map(str, reversed(b))))


t=int(input())
x=[int(a) for a in input().split(' ')]
for i in range(0,t-1):
    print((x[i]+x[i+1]),end=" ")
print(x[t-1])
    


import sys, math
n = int(input())
z = list(map(int, input().split()))
z.append(0)
for i in range(n):
    print(z[i] + z[i + 1], end = ' ')