n = int(eval(input()))

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



x_2 = 0

for i in range(n):

    if i % 2:

        x_2 -= a[i]

    else:

        x_2 += a[i]



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

for j in range(n):

    if j == 0:

        ans[j] = x_2 // 2

    else:

        ans[j] = a[j - 1] - ans[j - 1]



print((*[a * 2 for a in ans]))

import sys



sys.setrecursionlimit(10 ** 7)

input = sys.stdin.readline

f_inf = float('inf')

mod = 10 ** 9 + 7





def resolve():

    n = int(eval(input()))

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



    B = [0] * n

    for i in range(n):

        B[0] += A[i] if i % 2 == 0 else -A[i]



    for j in range(1, n):

        B[j] = 2 * A[j - 1] - B[j - 1]



    print((*B))





if __name__ == '__main__':

    resolve()

n = int(eval(input()))
a = list(map(int, input().split()))
x_2 = 0
for i in range(n):
    if i % 2:
        x_2 -= a[i]
    else:
        x_2 += a[i]
ans = [0 for _ in range(n)]
for j in range(n):
    if j == 0:
        ans[j] = x_2 // 2
    else:
        ans[j] = a[j - 1] - ans[j - 1]
print((*[a * 2 for a in ans]))

import sys

sys.setrecursionlimit(10**7)
input = sys.stdin.readline
f_inf = float("inf")
mod = 10**9 + 7


def resolve():
    n = int(eval(input()))
    A = list(map(int, input().split()))
    B = [0] * n
    for i in range(n):
        B[0] += A[i] if i % 2 == 0 else -A[i]
    for j in range(1, n):
        B[j] = 2 * A[j - 1] - B[j - 1]
    print((*B))


if __name__ == "__main__":
    resolve()

-n = int(eval(input())) -a = list(map(int, input().split())) -x_2 = 0 -for i in range(n): -    if i % 2: -        x_2 -= a[i] -    else: -        x_2 += a[i] -ans = [0 for _ in range(n)] -for j in range(n): -    if j == 0: -        ans[j] = x_2 // 2 -    else: -        ans[j] = a[j - 1] - ans[j - 1] -print((*[a * 2 for a in ans])) +import sys + +sys.setrecursionlimit(10**7) +input = sys.stdin.readline +f_inf = float("inf") +mod = 10**9 + 7 + + +def resolve(): +    n = int(eval(input())) +    A = list(map(int, input().split())) +    B = [0] * n +    for i in range(n): +        B[0] += A[i] if i % 2 == 0 else -A[i] +    for j in range(1, n): +        B[j] = 2 * A[j - 1] - B[j - 1] +    print((*B)) + + +if __name__ == "__main__": +    resolve()