import numpy as np

import sys



n = int(input())



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



a_sum = sum(a)

# x[i]はi番目のダムに溜まった水の半分

x = []



x_0 = int(a_sum/2)



for i in range(int((n-1)/2)):

    x_0 -= a[2*i+1]



x.append(x_0)

x_tmp = x_0



for i in range(n-1):

    x_tmp = a[i] - x_tmp

    x.append(x_tmp)



for wa in x:

    print(wa*2, end=' ')

import numpy as np

import sys



n = int(input())



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



a_sum = sum(a)

# x[i]はi番目のダムに溜まった水の半分

x = []



x_0 = int(a_sum/2)



for i in range(int((n-1)/2)):

    x_0 -= a[2*i+1]



x.append(x_0)

x_tmp = x_0



for i in range(n-1):

    x_tmp = a[i] - x_tmp

    x.append(x_tmp)



x = list(map(lambda y: y*2, x))



print(*x, sep=' ')

import numpy as np
import sys

n = int(input())
a = list(map(int, input().split()))
a_sum = sum(a)
# x[i]はi番目のダムに溜まった水の半分
x = []
x_0 = int(a_sum / 2)
for i in range(int((n - 1) / 2)):
    x_0 -= a[2 * i + 1]
x.append(x_0)
x_tmp = x_0
for i in range(n - 1):
    x_tmp = a[i] - x_tmp
    x.append(x_tmp)
for wa in x:
    print(wa * 2, end=" ")

import numpy as np
import sys

n = int(input())
a = list(map(int, input().split()))
a_sum = sum(a)
# x[i]はi番目のダムに溜まった水の半分
x = []
x_0 = int(a_sum / 2)
for i in range(int((n - 1) / 2)):
    x_0 -= a[2 * i + 1]
x.append(x_0)
x_tmp = x_0
for i in range(n - 1):
    x_tmp = a[i] - x_tmp
    x.append(x_tmp)
x = list(map(lambda y: y * 2, x))
print(*x, sep=" ")

-for wa in x: -    print(wa * 2, end=" ") +x = list(map(lambda y: y * 2, x)) +print(*x, sep=" ")