n = int(input())

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

A = sum(a)

A_odd = [0]

A_even = [0]

for i in range((n+1)//2):

    A_odd.append(A_odd[i] + a[2*i])

for i in range((n-1)//2):

    A_even.append(A_even[i] + a[2*i+1])









for i in range(n):

    if i %2 == 0:

        x = A - 2*A_odd[i//2]-2*(A_even[(n-1)//2]-A_even[i//2])

    else:

        x = A - 2*A_even[(i-1)//2]-2*(A_odd[(n+1)//2]-A_odd[(i+1)//2])

    print(x,end=" ")



print()

n = int(eval(input()))

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



ans = []

x  = 0

for  i in range(n):

    if i%2 == 0:

        x += a[i]

    else:

        x -= a[i]



ans.append(x)

for i in range(n-1):

    ans.append(2*a[i]-ans[-1])



print((*ans))
n = int(input())
a = list(map(int, input().split()))
A = sum(a)
A_odd = [0]
A_even = [0]
for i in range((n + 1) // 2):
    A_odd.append(A_odd[i] + a[2 * i])
for i in range((n - 1) // 2):
    A_even.append(A_even[i] + a[2 * i + 1])
for i in range(n):
    if i % 2 == 0:
        x = A - 2 * A_odd[i // 2] - 2 * (A_even[(n - 1) // 2] - A_even[i // 2])
    else:
        x = (
            A
            - 2 * A_even[(i - 1) // 2]
            - 2 * (A_odd[(n + 1) // 2] - A_odd[(i + 1) // 2])
        )
    print(x, end=" ")
print()

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

-n = int(input()) +n = int(eval(input())) -A = sum(a) -A_odd = [0] -A_even = [0] -for i in range((n + 1) // 2): -    A_odd.append(A_odd[i] + a[2 * i]) -for i in range((n - 1) // 2): -    A_even.append(A_even[i] + a[2 * i + 1]) +ans = [] +x = 0 -        x = A - 2 * A_odd[i // 2] - 2 * (A_even[(n - 1) // 2] - A_even[i // 2]) +        x += a[i] -        x = ( -            A -            - 2 * A_even[(i - 1) // 2] -            - 2 * (A_odd[(n + 1) // 2] - A_odd[(i + 1) // 2]) -        ) -    print(x, end=" ") -print() +        x -= a[i] +ans.append(x) +for i in range(n - 1): +    ans.append(2 * a[i] - ans[-1]) +print((*ans))