N=int(eval(input()))

k=N//2

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

DD=D[:]+D[:]

DS=[0]*(2*N+1)

for i in range(0,2*N-2,2):

  DS[i+2]=DS[i]+DD[i]

  DS[i+3]=DS[i+1]+DD[i+1]

T=sum(D)

ret=[0]*N

for i in range(N):

  ret[i]=T-2*(DS[i+1+2*k]-DS[i+1])

print((*ret))

N=int(eval(input()))

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

ret=[0]*N

ret[0]=sum(D)-2*sum(D[1:N:2])

for i in range(1,N):

  ret[i]=2*D[i-1]-ret[i-1]

print((*ret))
N = int(eval(input()))
k = N // 2
D = list(map(int, input().split()))
DD = D[:] + D[:]
DS = [0] * (2 * N + 1)
for i in range(0, 2 * N - 2, 2):
    DS[i + 2] = DS[i] + DD[i]
    DS[i + 3] = DS[i + 1] + DD[i + 1]
T = sum(D)
ret = [0] * N
for i in range(N):
    ret[i] = T - 2 * (DS[i + 1 + 2 * k] - DS[i + 1])
print((*ret))

N = int(eval(input()))
D = list(map(int, input().split()))
ret = [0] * N
ret[0] = sum(D) - 2 * sum(D[1:N:2])
for i in range(1, N):
    ret[i] = 2 * D[i - 1] - ret[i - 1]
print((*ret))

-k = N // 2 -DD = D[:] + D[:] -DS = [0] * (2 * N + 1) -for i in range(0, 2 * N - 2, 2): -    DS[i + 2] = DS[i] + DD[i] -    DS[i + 3] = DS[i + 1] + DD[i + 1] -T = sum(D) -for i in range(N): -    ret[i] = T - 2 * (DS[i + 1 + 2 * k] - DS[i + 1]) +ret[0] = sum(D) - 2 * sum(D[1:N:2]) +for i in range(1, N): +    ret[i] = 2 * D[i - 1] - ret[i - 1]