N, *A = list(map(int, open(0).read().split()))



ans = [0] * N

for i in range(N):

    ans[0] += A[i] * (-1) ** int(i % 2 != 0)



for i in reversed(list(range(1, N))):

    ans[i] = 2 * A[i] - ans[(i + 1) % N]

    

print((*ans))
N, *A = list(map(int, open(0).read().split()))



ans = [0] * N

for i in range(N):

    ans[0] += (-1) ** i * A[i]

    

for i in range(1, N):

    ans[i] = (A[i - 1] - ans[i - 1] // 2) * 2

    

print((*ans))

N, *A = list(map(int, open(0).read().split()))
ans = [0] * N
for i in range(N):
    ans[0] += A[i] * (-1) ** int(i % 2 != 0)
for i in reversed(list(range(1, N))):
    ans[i] = 2 * A[i] - ans[(i + 1) % N]
print((*ans))

N, *A = list(map(int, open(0).read().split()))
ans = [0] * N
for i in range(N):
    ans[0] += (-1) ** i * A[i]
for i in range(1, N):
    ans[i] = (A[i - 1] - ans[i - 1] // 2) * 2
print((*ans))

-    ans[0] += A[i] * (-1) ** int(i % 2 != 0) -for i in reversed(list(range(1, N))): -    ans[i] = 2 * A[i] - ans[(i + 1) % N] +    ans[0] += (-1) ** i * A[i] +for i in range(1, N): +    ans[i] = (A[i - 1] - ans[i - 1] // 2) * 2