N=int(input())

A=[i for i in map(int,input().split())]

X=[0]*N

for i in range(N//2):

    X[0]+=A[i*2]-A[i*2+1]

X[0]+=A[N-1]

for i in range(1, N):

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



for x in X:

    print(x,end=" ")

print()

N=int(eval(input()))

A=[i for i in map(int,input().split())]



X=[0]*N

X[0]=sum(A[0::2])-sum(A[1::2])



for i in range(1, N):

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



print((' '.join(map(str,X))))

N = int(input())
A = [i for i in map(int, input().split())]
X = [0] * N
for i in range(N // 2):
    X[0] += A[i * 2] - A[i * 2 + 1]
X[0] += A[N - 1]
for i in range(1, N):
    X[i] = 2 * A[i - 1] - X[i - 1]
for x in X:
    print(x, end=" ")
print()

N = int(eval(input()))
A = [i for i in map(int, input().split())]
X = [0] * N
X[0] = sum(A[0::2]) - sum(A[1::2])
for i in range(1, N):
    X[i] = 2 * A[i - 1] - X[i - 1]
print((" ".join(map(str, X))))

-N = int(input()) +N = int(eval(input())) -for i in range(N // 2): -    X[0] += A[i * 2] - A[i * 2 + 1] -X[0] += A[N - 1] +X[0] = sum(A[0::2]) - sum(A[1::2]) -for x in X: -    print(x, end=" ") -print() +print((" ".join(map(str, X))))