import sys

import numpy as np



sr = lambda: sys.stdin.readline().rstrip()

ir = lambda: int(sr())

lr = lambda: list(map(int, sr().split()))



N = ir()

A = np.array(lr())

sum_water = A.sum()

A *= 2

m1 = sum_water - A[1::2].sum() # 山１に降った水

print(m1, end=' ')

cur = m1

for a in A[:-1]:

    print(a - cur, end=' ')

    cur = a - cur

# 20

import sys

import numpy as np



sr = lambda: sys.stdin.readline().rstrip()

ir = lambda: int(sr())

lr = lambda: list(map(int, sr().split()))



N = ir()

A = np.array(lr())



total = A.sum()

answer = [0] * N

answer[0] = total - A[1::2].sum() * 2

A = A.tolist()

for i in range(1, N):

    answer[i] = A[i-1]*2 - answer[i-1]

print((*answer))
import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
N = ir()
A = np.array(lr())
sum_water = A.sum()
A *= 2
m1 = sum_water - A[1::2].sum()  # 山１に降った水
print(m1, end=" ")
cur = m1
for a in A[:-1]:
    print(a - cur, end=" ")
    cur = a - cur
# 20

import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
N = ir()
A = np.array(lr())
total = A.sum()
answer = [0] * N
answer[0] = total - A[1::2].sum() * 2
A = A.tolist()
for i in range(1, N):
    answer[i] = A[i - 1] * 2 - answer[i - 1]
print((*answer))

-sum_water = A.sum() -A *= 2 -m1 = sum_water - A[1::2].sum()  # 山１に降った水 -print(m1, end=" ") -cur = m1 -for a in A[:-1]: -    print(a - cur, end=" ") -    cur = a - cur -# 20 +total = A.sum() +answer = [0] * N +answer[0] = total - A[1::2].sum() * 2 +A = A.tolist() +for i in range(1, N): +    answer[i] = A[i - 1] * 2 - answer[i - 1] +print((*answer))