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

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



x = 0

for a in A:

    x = (a - x//2) * 2



x //= 2

ans = []

for a in A:

    ans.append(x)

    x = (a - x//2) * 2

print((*ans))
N = int(eval(input()))

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

e = sum(A[::2])

o = sum(A[1::2])

ans = [e-o]

for a in A:

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

ans.pop()

print((*ans))
N = list(map(int, input().split()))
A = list(map(int, input().split()))
x = 0
for a in A:
    x = (a - x // 2) * 2
x //= 2
ans = []
for a in A:
    ans.append(x)
    x = (a - x // 2) * 2
print((*ans))

N = int(eval(input()))
A = list(map(int, input().split()))
e = sum(A[::2])
o = sum(A[1::2])
ans = [e - o]
for a in A:
    ans.append(2 * (a - ans[-1] // 2))
ans.pop()
print((*ans))

-N = list(map(int, input().split())) +N = int(eval(input())) -x = 0 +e = sum(A[::2]) +o = sum(A[1::2]) +ans = [e - o] -    x = (a - x // 2) * 2 -x //= 2 -ans = [] -for a in A: -    ans.append(x) -    x = (a - x // 2) * 2 +    ans.append(2 * (a - ans[-1] // 2)) +ans.pop()