N = int(eval(input()))

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



x = [0 for _ in range(N)]

for i in range(N):

    if i % 2 == 0:

        x[0] += A[i]

    else:

        x[0] -= A[i]

x[0] //= 2

for i in range(1, N):

    x[i] = A[i - 1] - x[i - 1]

ans = ' '.join(str(2 * X) for X in x)



print(ans)

from itertools import accumulate



N = int(eval(input()))

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



# x_1 = (A_1 - A_2 + A_3 - A_4 + ... + A_N) / 2 である

# x_2 以降は代入しながら求めればよい

ans = ' '.join(

    str(2 * x)

    for x in accumulate(

        [sum((-1)**i * A[i] for i in range(N)) // 2] + A[:-1],

        lambda acc, a: a - acc

    )

)



print(ans)

N = int(eval(input()))
A = list(map(int, input().split()))
x = [0 for _ in range(N)]
for i in range(N):
    if i % 2 == 0:
        x[0] += A[i]
    else:
        x[0] -= A[i]
x[0] //= 2
for i in range(1, N):
    x[i] = A[i - 1] - x[i - 1]
ans = " ".join(str(2 * X) for X in x)
print(ans)

from itertools import accumulate

N = int(eval(input()))
A = list(map(int, input().split()))
# x_1 = (A_1 - A_2 + A_3 - A_4 + ... + A_N) / 2 である
# x_2 以降は代入しながら求めればよい
ans = " ".join(
    str(2 * x)
    for x in accumulate(
        [sum((-1) ** i * A[i] for i in range(N)) // 2] + A[:-1], lambda acc, a: a - acc
    )
)
print(ans)

+from itertools import accumulate + -x = [0 for _ in range(N)] -for i in range(N): -    if i % 2 == 0: -        x[0] += A[i] -    else: -        x[0] -= A[i] -x[0] //= 2 -for i in range(1, N): -    x[i] = A[i - 1] - x[i - 1] -ans = " ".join(str(2 * X) for X in x) +# x_1 = (A_1 - A_2 + A_3 - A_4 + ... + A_N) / 2 である +# x_2 以降は代入しながら求めればよい +ans = " ".join( +    str(2 * x) +    for x in accumulate( +        [sum((-1) ** i * A[i] for i in range(N)) // 2] + A[:-1], lambda acc, a: a - acc +    ) +)