from collections import deque

N = int(input())

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

X = [0]*(N+1)

S = sum(A)



even_list = [A[i] for i in range(1, N) if (i+1) % 2 == 0]

odd_list = [A[i] for i in range(1, N) if (i+1) % 2 != 0]



X[1] = S - 2 * sum(even_list)

X[2] = S - 2 * sum(odd_list)



even = sum(even_list)

odd = sum(odd_list)

s_even_idx = 2

s_odd_idx = 3

t_even_idx = N-1

t_odd_idx = N

A = A + A



for i in range(3, N+1):

  if i%2:

    even -= A[s_even_idx-1]

    s_even_idx += 2 

    t_even_idx += 2 

    even += A[t_even_idx-1]

    X[i] = S - 2 * even

  else:

    odd -= A[s_odd_idx-1]

    s_odd_idx += 2

    t_odd_idx += 2

    odd += A[t_odd_idx-1]

    X[i] = S - 2 * odd



for i in range(1, N+1):

  print(X[i], end=" ")

    

N = int(eval(input()))

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

S = sum(A)

A = A + A

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

b_even = sum([A[i] for i in range(2, N) if (i+1)%2!=0 ])

b_odd_s, b_odd_t = 2, N-1

b_even_s, b_even_t = 3, N



B = [0]*N

B[0] = str(S - 2*b_odd)

B[1] = str(S - 2*b_even)



for i in range(2, N):

  if (i+1) % 2:

    b_odd -= A[b_odd_s-1]

    b_odd_s += 2

    b_odd_t += 2 

    b_odd += A[b_odd_t-1]

    B[i] = str(S - 2*b_odd)

  else:

    b_even -= A[b_even_s-1]

    b_even_s += 2

    b_even_t += 2 

    b_even += A[b_even_t-1]

    B[i] = str(S - 2*b_even)



print((*B))    
from collections import deque

N = int(input())
A = list(map(int, input().split()))
X = [0] * (N + 1)
S = sum(A)
even_list = [A[i] for i in range(1, N) if (i + 1) % 2 == 0]
odd_list = [A[i] for i in range(1, N) if (i + 1) % 2 != 0]
X[1] = S - 2 * sum(even_list)
X[2] = S - 2 * sum(odd_list)
even = sum(even_list)
odd = sum(odd_list)
s_even_idx = 2
s_odd_idx = 3
t_even_idx = N - 1
t_odd_idx = N
A = A + A
for i in range(3, N + 1):
    if i % 2:
        even -= A[s_even_idx - 1]
        s_even_idx += 2
        t_even_idx += 2
        even += A[t_even_idx - 1]
        X[i] = S - 2 * even
    else:
        odd -= A[s_odd_idx - 1]
        s_odd_idx += 2
        t_odd_idx += 2
        odd += A[t_odd_idx - 1]
        X[i] = S - 2 * odd
for i in range(1, N + 1):
    print(X[i], end=" ")

N = int(eval(input()))
A = list(map(int, input().split()))
S = sum(A)
A = A + A
b_odd = sum([A[i] for i in range(1, N) if (i + 1) % 2 == 0])
b_even = sum([A[i] for i in range(2, N) if (i + 1) % 2 != 0])
b_odd_s, b_odd_t = 2, N - 1
b_even_s, b_even_t = 3, N
B = [0] * N
B[0] = str(S - 2 * b_odd)
B[1] = str(S - 2 * b_even)
for i in range(2, N):
    if (i + 1) % 2:
        b_odd -= A[b_odd_s - 1]
        b_odd_s += 2
        b_odd_t += 2
        b_odd += A[b_odd_t - 1]
        B[i] = str(S - 2 * b_odd)
    else:
        b_even -= A[b_even_s - 1]
        b_even_s += 2
        b_even_t += 2
        b_even += A[b_even_t - 1]
        B[i] = str(S - 2 * b_even)
print((*B))

-from collections import deque - -N = int(input()) +N = int(eval(input())) -X = [0] * (N + 1) -even_list = [A[i] for i in range(1, N) if (i + 1) % 2 == 0] -odd_list = [A[i] for i in range(1, N) if (i + 1) % 2 != 0] -X[1] = S - 2 * sum(even_list) -X[2] = S - 2 * sum(odd_list) -even = sum(even_list) -odd = sum(odd_list) -s_even_idx = 2 -s_odd_idx = 3 -t_even_idx = N - 1 -t_odd_idx = N -for i in range(3, N + 1): -    if i % 2: -        even -= A[s_even_idx - 1] -        s_even_idx += 2 -        t_even_idx += 2 -        even += A[t_even_idx - 1] -        X[i] = S - 2 * even +b_odd = sum([A[i] for i in range(1, N) if (i + 1) % 2 == 0]) +b_even = sum([A[i] for i in range(2, N) if (i + 1) % 2 != 0]) +b_odd_s, b_odd_t = 2, N - 1 +b_even_s, b_even_t = 3, N +B = [0] * N +B[0] = str(S - 2 * b_odd) +B[1] = str(S - 2 * b_even) +for i in range(2, N): +    if (i + 1) % 2: +        b_odd -= A[b_odd_s - 1] +        b_odd_s += 2 +        b_odd_t += 2 +        b_odd += A[b_odd_t - 1] +        B[i] = str(S - 2 * b_odd) -        odd -= A[s_odd_idx - 1] -        s_odd_idx += 2 -        t_odd_idx += 2 -        odd += A[t_odd_idx - 1] -        X[i] = S - 2 * odd -for i in range(1, N + 1): -    print(X[i], end=" ") +        b_even -= A[b_even_s - 1] +        b_even_s += 2 +        b_even_t += 2 +        b_even += A[b_even_t - 1] +        B[i] = str(S - 2 * b_even) +print((*B))