N = int(eval(input()))

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

left = 0

right = 2 * A[0] + 2

while left < right:

    rain = [0] * N

    rain[0] = (left + right) // 4 * 2

    for i in range(N-1):

        rain[i+1] = 2 * A[i] - rain[i]

    rain0 = 2 * A[-1] - rain[-1]

    if rain[0] > rain0:

        right = rain[0]

    elif rain[0] < rain0:

        left = rain[0] + 2

    else:

        print((' '.join(map(str, rain))))

        exit()

N = int(eval(input()))

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

rain = [0] * N

rain[0] = sum(A) - 2 * sum(A[i] for i in range(1, N, 2))

for i in range(N-1):

    rain[i+1] = 2 * A[i] - rain[i]

print((' '.join(map(str, rain))))

N = int(eval(input()))
A = list(map(int, input().split()))
left = 0
right = 2 * A[0] + 2
while left < right:
    rain = [0] * N
    rain[0] = (left + right) // 4 * 2
    for i in range(N - 1):
        rain[i + 1] = 2 * A[i] - rain[i]
    rain0 = 2 * A[-1] - rain[-1]
    if rain[0] > rain0:
        right = rain[0]
    elif rain[0] < rain0:
        left = rain[0] + 2
    else:
        print((" ".join(map(str, rain))))
        exit()

N = int(eval(input()))
A = list(map(int, input().split()))
rain = [0] * N
rain[0] = sum(A) - 2 * sum(A[i] for i in range(1, N, 2))
for i in range(N - 1):
    rain[i + 1] = 2 * A[i] - rain[i]
print((" ".join(map(str, rain))))

-left = 0 -right = 2 * A[0] + 2 -while left < right: -    rain = [0] * N -    rain[0] = (left + right) // 4 * 2 -    for i in range(N - 1): -        rain[i + 1] = 2 * A[i] - rain[i] -    rain0 = 2 * A[-1] - rain[-1] -    if rain[0] > rain0: -        right = rain[0] -    elif rain[0] < rain0: -        left = rain[0] + 2 -    else: -        print((" ".join(map(str, rain)))) -        exit() +rain = [0] * N +rain[0] = sum(A) - 2 * sum(A[i] for i in range(1, N, 2)) +for i in range(N - 1): +    rain[i + 1] = 2 * A[i] - rain[i] +print((" ".join(map(str, rain))))