n = int(input())

a = [int(i) for i in input().split()]

x = [0] * n



not_x0 = 0

for i in range(1, n, 2):

    not_x0 += 2*a[i]



x[0] = sum(a) - not_x0

for i in range(1, n):

    x[i] = 2*a[i - 1] - x[i - 1]



for i in range(n):

    print(x[i], end=' ')

n = int(eval(input()))

a = [int(i) for i in input().split()]

x = [0] * n

x[0] = sum(a) - 2*sum(a[1::2])

for i in range(1, n):

    x[i] = 2*a[i - 1] - x[i - 1]



print((*x))
n = int(input())
a = [int(i) for i in input().split()]
x = [0] * n
not_x0 = 0
for i in range(1, n, 2):
    not_x0 += 2 * a[i]
x[0] = sum(a) - not_x0
for i in range(1, n):
    x[i] = 2 * a[i - 1] - x[i - 1]
for i in range(n):
    print(x[i], end=" ")

n = int(eval(input()))
a = [int(i) for i in input().split()]
x = [0] * n
x[0] = sum(a) - 2 * sum(a[1::2])
for i in range(1, n):
    x[i] = 2 * a[i - 1] - x[i - 1]
print((*x))

-n = int(input()) +n = int(eval(input())) -not_x0 = 0 -for i in range(1, n, 2): -    not_x0 += 2 * a[i] -x[0] = sum(a) - not_x0 +x[0] = sum(a) - 2 * sum(a[1::2]) -for i in range(n): -    print(x[i], end=" ") +print((*x))