N = int(eval(input()))

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



ans = []

m = sum(A[::2])-sum(A[1::2])

ans.append(m)



for i in range(N-1):

    m = 2*A[i]-m

    ans.append(m)

print((*ans))

N = int(eval(input()))

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



p = 0

for a in A:

    p = a*2-p



ans = [p//2]

for a in A[:-1]:

    ans.append(a*2-ans[-1])

print((*ans))

N = int(eval(input()))
A = [int(i) for i in input().split()]
ans = []
m = sum(A[::2]) - sum(A[1::2])
ans.append(m)
for i in range(N - 1):
    m = 2 * A[i] - m
    ans.append(m)
print((*ans))

N = int(eval(input()))
A = [int(i) for i in input().split()]
p = 0
for a in A:
    p = a * 2 - p
ans = [p // 2]
for a in A[:-1]:
    ans.append(a * 2 - ans[-1])
print((*ans))

-ans = [] -m = sum(A[::2]) - sum(A[1::2]) -ans.append(m) -for i in range(N - 1): -    m = 2 * A[i] - m -    ans.append(m) +p = 0 +for a in A: +    p = a * 2 - p +ans = [p // 2] +for a in A[:-1]: +    ans.append(a * 2 - ans[-1])