n=int(eval(input()))

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

e,o=l[0::2],l[1::2]

a=[0]*n

a[0]=sum(l)-sum(o)*2

p=o[0]

m=n//2

s=o+e

for i in range(m):

  a[i*2+2]=a[i*2]-s[m+i]*2+p*2

  p=s[i+1]

s=e+o

for i in range(m):

  a[i*2+1]=a[i*2-1]-s[m+i]*2+p*2

  p=s[i+1]

print((*a))
eval(input())

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

a=[]

t=sum(l)-sum(l[1::2])*2

for i in l:

  a+=[t]

  t=i*2-t

print((*a))
n = int(eval(input()))
l = list(map(int, input().split()))
e, o = l[0::2], l[1::2]
a = [0] * n
a[0] = sum(l) - sum(o) * 2
p = o[0]
m = n // 2
s = o + e
for i in range(m):
    a[i * 2 + 2] = a[i * 2] - s[m + i] * 2 + p * 2
    p = s[i + 1]
s = e + o
for i in range(m):
    a[i * 2 + 1] = a[i * 2 - 1] - s[m + i] * 2 + p * 2
    p = s[i + 1]
print((*a))

eval(input())
l = list(map(int, input().split()))
a = []
t = sum(l) - sum(l[1::2]) * 2
for i in l:
    a += [t]
    t = i * 2 - t
print((*a))

-n = int(eval(input())) +eval(input()) -e, o = l[0::2], l[1::2] -a = [0] * n -a[0] = sum(l) - sum(o) * 2 -p = o[0] -m = n // 2 -s = o + e -for i in range(m): -    a[i * 2 + 2] = a[i * 2] - s[m + i] * 2 + p * 2 -    p = s[i + 1] -s = e + o -for i in range(m): -    a[i * 2 + 1] = a[i * 2 - 1] - s[m + i] * 2 + p * 2 -    p = s[i + 1] +a = [] +t = sum(l) - sum(l[1::2]) * 2 +for i in l: +    a += [t] +    t = i * 2 - t