import numpy as np



N = int(eval(input()))

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

# dif = A1-A2+A3-A4 ...

dif = sum([A[i] * pow(-1, i) for i in range(N - 1)])

ans = [0] * N

ans[0] = A[-1] + dif

ans[-1] = A[-1] - dif

for i in range(1, N - 1):

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

print((*ans))

N = int(eval(input()))

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

# dif = A1-A2+A3-A4 ...

dif = sum([A[i] * pow(-1, i) for i in range(N - 1)])

ans = [0] * N

ans[0] = A[-1] + dif

ans[-1] = A[-1] - dif

for i in range(1, N - 1):

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

print((*ans))

import numpy as np

N = int(eval(input()))
A = np.array([int(i) for i in input().split()])
# dif = A1-A2+A3-A4 ...
dif = sum([A[i] * pow(-1, i) for i in range(N - 1)])
ans = [0] * N
ans[0] = A[-1] + dif
ans[-1] = A[-1] - dif
for i in range(1, N - 1):
    ans[i] = 2 * A[i - 1] - ans[i - 1]
print((*ans))

N = int(eval(input()))
A = [int(i) for i in input().split()]
# dif = A1-A2+A3-A4 ...
dif = sum([A[i] * pow(-1, i) for i in range(N - 1)])
ans = [0] * N
ans[0] = A[-1] + dif
ans[-1] = A[-1] - dif
for i in range(1, N - 1):
    ans[i] = 2 * A[i - 1] - ans[i - 1]
print((*ans))

-import numpy as np - -A = np.array([int(i) for i in input().split()]) +A = [int(i) for i in input().split()]