import sys

input = sys.stdin.readline



n = int(eval(input()))

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

res = sum(lis)

su = [0] * n



for i in range(n):

    if i < 2:

        su[i] = lis[i]

    else:

        su[i] = su[i-2] + lis[i]



ans = []

ans_a = ans.append



for i in range(n):

    if i == 0:

        b = su[-2]

        ans_a(res-2*b)

    elif i == 1:

        b = su[-1] - su[i-1]

        ans_a(res-2*b)

    elif i == n:

        b = su[-1] - lis[-1]

        ans_a(res-2*b)

    elif i % 2 == 0:

        b = su[-2] - su[i-1] + su[i-2]

        ans_a(res-2*b)

    else:

        b = su[-1] - su[i-1] + su[i-2]

        ans_a(res-2*b)

print((*ans))

import sys

input = sys.stdin.readline



n = int(eval(input()))

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



su1 = sum(lis)

su2 = sum(lis[1::2])



ans = [0] * n

ans[0] = su1 - 2 * su2



for i in range(1, n):

    ans[i] = 2 * lis[i - 1] - ans[i - 1]



print((*ans))

import sys

input = sys.stdin.readline
n = int(eval(input()))
lis = list(map(int, input().split()))
res = sum(lis)
su = [0] * n
for i in range(n):
    if i < 2:
        su[i] = lis[i]
    else:
        su[i] = su[i - 2] + lis[i]
ans = []
ans_a = ans.append
for i in range(n):
    if i == 0:
        b = su[-2]
        ans_a(res - 2 * b)
    elif i == 1:
        b = su[-1] - su[i - 1]
        ans_a(res - 2 * b)
    elif i == n:
        b = su[-1] - lis[-1]
        ans_a(res - 2 * b)
    elif i % 2 == 0:
        b = su[-2] - su[i - 1] + su[i - 2]
        ans_a(res - 2 * b)
    else:
        b = su[-1] - su[i - 1] + su[i - 2]
        ans_a(res - 2 * b)
print((*ans))

import sys

input = sys.stdin.readline
n = int(eval(input()))
lis = list(map(int, input().split()))
su1 = sum(lis)
su2 = sum(lis[1::2])
ans = [0] * n
ans[0] = su1 - 2 * su2
for i in range(1, n):
    ans[i] = 2 * lis[i - 1] - ans[i - 1]
print((*ans))

-res = sum(lis) -su = [0] * n -for i in range(n): -    if i < 2: -        su[i] = lis[i] -    else: -        su[i] = su[i - 2] + lis[i] -ans = [] -ans_a = ans.append -for i in range(n): -    if i == 0: -        b = su[-2] -        ans_a(res - 2 * b) -    elif i == 1: -        b = su[-1] - su[i - 1] -        ans_a(res - 2 * b) -    elif i == n: -        b = su[-1] - lis[-1] -        ans_a(res - 2 * b) -    elif i % 2 == 0: -        b = su[-2] - su[i - 1] + su[i - 2] -        ans_a(res - 2 * b) -    else: -        b = su[-1] - su[i - 1] + su[i - 2] -        ans_a(res - 2 * b) +su1 = sum(lis) +su2 = sum(lis[1::2]) +ans = [0] * n +ans[0] = su1 - 2 * su2 +for i in range(1, n): +    ans[i] = 2 * lis[i - 1] - ans[i - 1]