n = int(eval(input()))

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

ans = a[0]

l = []



for i in range(1, n, 2):

    ans -= a[i]

    ans += a[i + 1]



l.append(ans)



for i in range(n - 1):

    ans = a[i]*2 - ans

    l.append(ans)



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

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

l = []



ans = sum(a[0::2]) - sum(a[1::2])

l.append(ans)



for i in range(n - 1):

    l.append(a[i]*2 - l[i])



print((*l))
n = int(eval(input()))
a = list(map(int, input().split()))
ans = a[0]
l = []
for i in range(1, n, 2):
    ans -= a[i]
    ans += a[i + 1]
l.append(ans)
for i in range(n - 1):
    ans = a[i] * 2 - ans
    l.append(ans)
print((*l))

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

-ans = a[0] -for i in range(1, n, 2): -    ans -= a[i] -    ans += a[i + 1] +ans = sum(a[0::2]) - sum(a[1::2]) -    ans = a[i] * 2 - ans -    l.append(ans) +    l.append(a[i] * 2 - l[i])