n = int(input())

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

b = 0

for i in range(n):

    b += a[i] * (1-i%2*2)

print(b, end="")

for i in range(n-1):

    b = (a[i] - b//2) * 2

    print(" {}".format(b), end="")

print("")

n = int(input())

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

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

for i in range(n):

    print(x, end=' ')

    x = a[i]*2 - x

n = int(input())
a = list(map(int, input().split()))
b = 0
for i in range(n):
    b += a[i] * (1 - i % 2 * 2)
print(b, end="")
for i in range(n - 1):
    b = (a[i] - b // 2) * 2
    print(" {}".format(b), end="")
print("")

n = int(input())
a = list(map(int, input().split()))
x = sum(a) - sum(a[1::2]) * 2
for i in range(n):
    print(x, end=" ")
    x = a[i] * 2 - x

-b = 0 +x = sum(a) - sum(a[1::2]) * 2 -    b += a[i] * (1 - i % 2 * 2) -print(b, end="") -for i in range(n - 1): -    b = (a[i] - b // 2) * 2 -    print(" {}".format(b), end="") -print("") +    print(x, end=" ") +    x = a[i] * 2 - x