n = int(eval(input()))

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

SUM = sum(A)



dp = [0]*n

dp[0] = cnt = 0

for i in range(1, n):

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

    cnt += dp[i]



init = SUM-cnt

dp = [0]*n

dp[0] = cnt = init

for i in range(1, n):

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

    cnt += dp[i]



print((*dp))
n = int(eval(input()))

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

SUM = sum(A)

init = SUM - 2*sum(A[1::2])

dp = [0]*n

dp[0] = init

for i in range(1, n):

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

print((*dp))

n = int(eval(input()))
A = list(map(int, input().split()))
SUM = sum(A)
dp = [0] * n
dp[0] = cnt = 0
for i in range(1, n):
    dp[i] = 2 * A[i - 1] - dp[i - 1]
    cnt += dp[i]
init = SUM - cnt
dp = [0] * n
dp[0] = cnt = init
for i in range(1, n):
    dp[i] = 2 * A[i - 1] - dp[i - 1]
    cnt += dp[i]
print((*dp))

n = int(eval(input()))
A = list(map(int, input().split()))
SUM = sum(A)
init = SUM - 2 * sum(A[1::2])
dp = [0] * n
dp[0] = init
for i in range(1, n):
    dp[i] = 2 * A[i - 1] - dp[i - 1]
print((*dp))

+init = SUM - 2 * sum(A[1::2]) -dp[0] = cnt = 0 +dp[0] = init -    cnt += dp[i] -init = SUM - cnt -dp = [0] * n -dp[0] = cnt = init -for i in range(1, n): -    dp[i] = 2 * A[i - 1] - dp[i - 1] -    cnt += dp[i]