import numpy as np



N = int(eval(input()))

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



rain = [None]*N



rain[0] = sum(A) - 2*(sum(A[1:N-1:2]))

for i in range(1, N):

    rain[i] = 2*A[i-1] - rain[i-1]





print((*rain))
N = int(eval(input()))

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



rain = [None]*N



rain[0] = sum(A) - 2*(sum(A[1:N-1:2]))

for i in range(1, N):

    rain[i] = 2*A[i-1] - rain[i-1]





print((*rain))
import numpy as np

N = int(eval(input()))
A = tuple(map(int, input().split()))
rain = [None] * N
rain[0] = sum(A) - 2 * (sum(A[1 : N - 1 : 2]))
for i in range(1, N):
    rain[i] = 2 * A[i - 1] - rain[i - 1]
print((*rain))

N = int(eval(input()))
A = tuple(map(int, input().split()))
rain = [None] * N
rain[0] = sum(A) - 2 * (sum(A[1 : N - 1 : 2]))
for i in range(1, N):
    rain[i] = 2 * A[i - 1] - rain[i - 1]
print((*rain))

-import numpy as np -