import numpy as np



n = int(eval(input()))

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

yama = [-1] * n



min_dam = min(dam)

min_dam_arg = np.argmin(dam)



s = sum(dam)

yama[0] = s - 2 * sum(dam[1::2])

for i in range(1, n):

    yama[i] = 2 * (dam[i-1] - yama[i-1]/2)



yama = list(map(int, yama))

print((' '.join(map(str, yama))))
n = int(eval(input()))

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



m = [0 for i in range(n)]

for i in range(n):

    if i%2 == 0:

        m[0] += a[i]

    else:

        m[0] -= a[i]

for i in range(1, n):

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



print((' '.join(map(str, m))))
import numpy as np

n = int(eval(input()))
dam = list(map(int, input().split()))
yama = [-1] * n
min_dam = min(dam)
min_dam_arg = np.argmin(dam)
s = sum(dam)
yama[0] = s - 2 * sum(dam[1::2])
for i in range(1, n):
    yama[i] = 2 * (dam[i - 1] - yama[i - 1] / 2)
yama = list(map(int, yama))
print((" ".join(map(str, yama))))

n = int(eval(input()))
a = list(map(int, input().split()))
m = [0 for i in range(n)]
for i in range(n):
    if i % 2 == 0:
        m[0] += a[i]
    else:
        m[0] -= a[i]
for i in range(1, n):
    m[i] = 2 * a[i - 1] - m[i - 1]
print((" ".join(map(str, m))))

-import numpy as np - -dam = list(map(int, input().split())) -yama = [-1] * n -min_dam = min(dam) -min_dam_arg = np.argmin(dam) -s = sum(dam) -yama[0] = s - 2 * sum(dam[1::2]) +a = list(map(int, input().split())) +m = [0 for i in range(n)] +for i in range(n): +    if i % 2 == 0: +        m[0] += a[i] +    else: +        m[0] -= a[i] -    yama[i] = 2 * (dam[i - 1] - yama[i - 1] / 2) -yama = list(map(int, yama)) -print((" ".join(map(str, yama)))) +    m[i] = 2 * a[i - 1] - m[i - 1] +print((" ".join(map(str, m))))