N = int(eval(input()))

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

x = [0] * N

x[0] = sum([a[i] for i in range(N) if i % 2 == 0]) - sum([a[i] for i in range(N) if i % 2 != 0])

for i in range(N - 1):

    x[i + 1] = 2 * a[i] - x[i]

print((*x))
N = int(eval(input()))

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

x1 = sum(a) - 2 * sum([a[i] for i in range(N) if i % 2 == 1])

ans = [0] * N

ans[0] = x1

for i in range(N - 1):

    ans[i + 1] = 2 * a[i] - ans[i]

print((*ans))
N = int(eval(input()))
a = list(map(int, input().split()))
x = [0] * N
x[0] = sum([a[i] for i in range(N) if i % 2 == 0]) - sum(
    [a[i] for i in range(N) if i % 2 != 0]
)
for i in range(N - 1):
    x[i + 1] = 2 * a[i] - x[i]
print((*x))

N = int(eval(input()))
a = list(map(int, input().split()))
x1 = sum(a) - 2 * sum([a[i] for i in range(N) if i % 2 == 1])
ans = [0] * N
ans[0] = x1
for i in range(N - 1):
    ans[i + 1] = 2 * a[i] - ans[i]
print((*ans))

-x = [0] * N -x[0] = sum([a[i] for i in range(N) if i % 2 == 0]) - sum( -    [a[i] for i in range(N) if i % 2 != 0] -) +x1 = sum(a) - 2 * sum([a[i] for i in range(N) if i % 2 == 1]) +ans = [0] * N +ans[0] = x1 -    x[i + 1] = 2 * a[i] - x[i] -print((*x)) +    ans[i + 1] = 2 * a[i] - ans[i] +print((*ans))