import numpy as np



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



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

n = n[0]

ans = []



x = np.asarray(x)

double_x = 2 * x

x0 = 0

multiple = 1

for j in range(n):

    x0 += x[j] * multiple

    multiple *= -1

ans.append(x0)

for i in range(0, n-1):

    ans.append(double_x[i] - ans[i])



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

N = int(eval(input()))

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

c = 0

for idx, i in enumerate(a):

  if idx %2 ==0:

    c += i

  else: 

    c -= i

x1 = c

print(x1)

for i in range(1,N):

  x1 = 2*a[i-1] - x1

  print(x1)
import numpy as np

n = list(map(int, input().split()))
x = list(map(int, input().split()))
n = n[0]
ans = []
x = np.asarray(x)
double_x = 2 * x
x0 = 0
multiple = 1
for j in range(n):
    x0 += x[j] * multiple
    multiple *= -1
ans.append(x0)
for i in range(0, n - 1):
    ans.append(double_x[i] - ans[i])
print(" ".join(map(str, ans)))

N = int(eval(input()))
a = list(map(int, input().split()))
c = 0
for idx, i in enumerate(a):
    if idx % 2 == 0:
        c += i
    else:
        c -= i
x1 = c
print(x1)
for i in range(1, N):
    x1 = 2 * a[i - 1] - x1
    print(x1)

-import numpy as np - -n = list(map(int, input().split())) -x = list(map(int, input().split())) -n = n[0] -ans = [] -x = np.asarray(x) -double_x = 2 * x -x0 = 0 -multiple = 1 -for j in range(n): -    x0 += x[j] * multiple -    multiple *= -1 -ans.append(x0) -for i in range(0, n - 1): -    ans.append(double_x[i] - ans[i]) -print(" ".join(map(str, ans))) +N = int(eval(input())) +a = list(map(int, input().split())) +c = 0 +for idx, i in enumerate(a): +    if idx % 2 == 0: +        c += i +    else: +        c -= i +x1 = c +print(x1) +for i in range(1, N): +    x1 = 2 * a[i - 1] - x1 +    print(x1)