N = int(input())

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

S = sum(Alist)

Xlist = [0] * N

Xlist[0] = S - 2 * sum([Alist[_] for _ in range(1, N, 2)])

print(Xlist[0], end=" ")

for i in range(1, N):

    Xlist[i] = 2*Alist[i-1] - Xlist[i-1]

    print(Xlist[i], end=" ")

print()

N = int(eval(input()))

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

S = sum(Alist)



ans = [S - sum([2 * Alist[i] for i in range(1, N - 1, 2)])]

for i in range(1, N):

    ans.append(-ans[i - 1] + 2 * Alist[i - 1])





print((*ans))
N = int(input())
Alist = list(map(int, input().split()))
S = sum(Alist)
Xlist = [0] * N
Xlist[0] = S - 2 * sum([Alist[_] for _ in range(1, N, 2)])
print(Xlist[0], end=" ")
for i in range(1, N):
    Xlist[i] = 2 * Alist[i - 1] - Xlist[i - 1]
    print(Xlist[i], end=" ")
print()

N = int(eval(input()))
Alist = list(map(int, input().split()))
S = sum(Alist)
ans = [S - sum([2 * Alist[i] for i in range(1, N - 1, 2)])]
for i in range(1, N):
    ans.append(-ans[i - 1] + 2 * Alist[i - 1])
print((*ans))

-N = int(input()) +N = int(eval(input())) -Xlist = [0] * N -Xlist[0] = S - 2 * sum([Alist[_] for _ in range(1, N, 2)]) -print(Xlist[0], end=" ") +ans = [S - sum([2 * Alist[i] for i in range(1, N - 1, 2)])] -    Xlist[i] = 2 * Alist[i - 1] - Xlist[i - 1] -    print(Xlist[i], end=" ") -print() +    ans.append(-ans[i - 1] + 2 * Alist[i - 1]) +print((*ans))