import sys

n = int(eval(input()))

a = [ 2*int(i) for i in sys.stdin.readline().split()]

ans = [0 for i in range(n)]

for i in range(1, n):

    ans[i] = a[i-1] - ans[i-1]

ans[0] = (a[n-1] - ans[n-1])//2

for i in range(1, n):

    ans[i] +=  ans[0]*(-1)**(i%2)

print((" ".join(map(str, ans))))

import sys

n = int(eval(input()))

a = [ 2*int(i) for i in sys.stdin.readline().split()]

f = (sum(a) - 2* sum(a[1::2]))//2

ans = [f] + [0 for i in range(n-1)]

for i in range(n-1):

    ans[i+1] =  a[i] - ans[i]

print((" ".join(map(str, ans))))

import sys

n = int(eval(input()))
a = [2 * int(i) for i in sys.stdin.readline().split()]
ans = [0 for i in range(n)]
for i in range(1, n):
    ans[i] = a[i - 1] - ans[i - 1]
ans[0] = (a[n - 1] - ans[n - 1]) // 2
for i in range(1, n):
    ans[i] += ans[0] * (-1) ** (i % 2)
print((" ".join(map(str, ans))))

import sys

n = int(eval(input()))
a = [2 * int(i) for i in sys.stdin.readline().split()]
f = (sum(a) - 2 * sum(a[1::2])) // 2
ans = [f] + [0 for i in range(n - 1)]
for i in range(n - 1):
    ans[i + 1] = a[i] - ans[i]
print((" ".join(map(str, ans))))

-ans = [0 for i in range(n)] -for i in range(1, n): -    ans[i] = a[i - 1] - ans[i - 1] -ans[0] = (a[n - 1] - ans[n - 1]) // 2 -for i in range(1, n): -    ans[i] += ans[0] * (-1) ** (i % 2) +f = (sum(a) - 2 * sum(a[1::2])) // 2 +ans = [f] + [0 for i in range(n - 1)] +for i in range(n - 1): +    ans[i + 1] = a[i] - ans[i]