from sys import stdin

n = int(stdin.readline().rstrip())

li = list(map(int,stdin.readline().rstrip().split()))

point = 0

for i in range(n):

    if i%2 == 0:

        point += li[i]

    else:

        point -= li[i]

lin = [point]

for i in range(n-1):

    lin.append((li[i]-lin[i]//2)*2)

print((*lin))
n = int(eval(input()))

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



s = sum(a)



start = s-2*sum(a[1::2])



li = [start]



for i in range(1,n):

    li.append(2*a[i-1]-li[-1])



print((*li))
from sys import stdin

n = int(stdin.readline().rstrip())
li = list(map(int, stdin.readline().rstrip().split()))
point = 0
for i in range(n):
    if i % 2 == 0:
        point += li[i]
    else:
        point -= li[i]
lin = [point]
for i in range(n - 1):
    lin.append((li[i] - lin[i] // 2) * 2)
print((*lin))

n = int(eval(input()))
a = list(map(int, input().split()))
s = sum(a)
start = s - 2 * sum(a[1::2])
li = [start]
for i in range(1, n):
    li.append(2 * a[i - 1] - li[-1])
print((*li))

-from sys import stdin - -n = int(stdin.readline().rstrip()) -li = list(map(int, stdin.readline().rstrip().split())) -point = 0 -for i in range(n): -    if i % 2 == 0: -        point += li[i] -    else: -        point -= li[i] -lin = [point] -for i in range(n - 1): -    lin.append((li[i] - lin[i] // 2) * 2) -print((*lin)) +n = int(eval(input())) +a = list(map(int, input().split())) +s = sum(a) +start = s - 2 * sum(a[1::2]) +li = [start] +for i in range(1, n): +    li.append(2 * a[i - 1] - li[-1]) +print((*li))