N=int(eval(input()))

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



ans=[0]*N

t=0

for i in range(N):

    if i%2==0:

        t+=A[i]

    else:

        t-=A[i]

t=t/2

ans[0]=t

for i in range(1,N):

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

for i in range(N):

    ans[i]=int(2*ans[i])

print((*ans[0:]))
N = int(eval(input()))

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



ans = []

res = 0

for i in range(N):

    if i%2==0:

        res += A[i]

    else:

        res -= A[i]



ans.append(res)



for i in range(1,N):

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

    ans.append(res)



print((*ans))
N = int(eval(input()))
A = list(map(int, input().split()))
ans = [0] * N
t = 0
for i in range(N):
    if i % 2 == 0:
        t += A[i]
    else:
        t -= A[i]
t = t / 2
ans[0] = t
for i in range(1, N):
    ans[i] = A[i - 1] - ans[i - 1]
for i in range(N):
    ans[i] = int(2 * ans[i])
print((*ans[0:]))

N = int(eval(input()))
A = list(map(int, input().split()))
ans = []
res = 0
for i in range(N):
    if i % 2 == 0:
        res += A[i]
    else:
        res -= A[i]
ans.append(res)
for i in range(1, N):
    res = 2 * A[i - 1] - ans[-1]
    ans.append(res)
print((*ans))

-ans = [0] * N -t = 0 +ans = [] +res = 0 -        t += A[i] +        res += A[i] -        t -= A[i] -t = t / 2 -ans[0] = t +        res -= A[i] +ans.append(res) -    ans[i] = A[i - 1] - ans[i - 1] -for i in range(N): -    ans[i] = int(2 * ans[i]) -print((*ans[0:])) +    res = 2 * A[i - 1] - ans[-1] +    ans.append(res) +print((*ans))