N = int(eval(input()))

*A, = list(map(int, input().split()))

X = [0]*N

X_total = sum(A)

A_odd = sum([A[i % N] for i in range(1, N, 2)])

A_even = sum([A[i % N] for i in range(2, N+1, 2)])

for i in range(N):

    X[i] = X_total - 2*(A_odd if i % 2 == 0 else A_even)

    if i % 2 == 0: A_odd += A[i] - A[(i+1) % N]

    else: A_even += A[i] - A[(i+1) % N]

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

*A, = list(map(int, input().split()))

X = [0]*N

total = sum(A)

X[0] = total - 2*sum([a for a in A[1::2]])

for i in range(1, N):

    X[i] = 2*A[i-1] - X[i-1]

print((*X))
N = int(eval(input()))
(*A,) = list(map(int, input().split()))
X = [0] * N
X_total = sum(A)
A_odd = sum([A[i % N] for i in range(1, N, 2)])
A_even = sum([A[i % N] for i in range(2, N + 1, 2)])
for i in range(N):
    X[i] = X_total - 2 * (A_odd if i % 2 == 0 else A_even)
    if i % 2 == 0:
        A_odd += A[i] - A[(i + 1) % N]
    else:
        A_even += A[i] - A[(i + 1) % N]
print((*X))

N = int(eval(input()))
(*A,) = list(map(int, input().split()))
X = [0] * N
total = sum(A)
X[0] = total - 2 * sum([a for a in A[1::2]])
for i in range(1, N):
    X[i] = 2 * A[i - 1] - X[i - 1]
print((*X))

-X_total = sum(A) -A_odd = sum([A[i % N] for i in range(1, N, 2)]) -A_even = sum([A[i % N] for i in range(2, N + 1, 2)]) -for i in range(N): -    X[i] = X_total - 2 * (A_odd if i % 2 == 0 else A_even) -    if i % 2 == 0: -        A_odd += A[i] - A[(i + 1) % N] -    else: -        A_even += A[i] - A[(i + 1) % N] +total = sum(A) +X[0] = total - 2 * sum([a for a in A[1::2]]) +for i in range(1, N): +    X[i] = 2 * A[i - 1] - X[i - 1]