from scipy.sparse import csr_matrix

from scipy.sparse.linalg import spsolve

import numpy as np

N = int(eval(input()))

A = np.array(input().split())



rows = np.concatenate([np.arange(N), np.arange(N)])

cols = np.concatenate([np.arange(N), np.arange(1,N+1) % N])

mat = csr_matrix(([1] * (2*N), (rows, cols)), (N,N))



answer = (spsolve(mat,A) * 2 + .5).astype(int)

print((*answer))
import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines



N,*A = list(map(int,read().split()))



S = sum(A)

x = S//2 - sum(A[1::2])



rain = [x+x]

for x in A[:-1]:

    rain.append(x+x-rain[-1])

print((' '.join(map(str,rain))))
from scipy.sparse import csr_matrix
from scipy.sparse.linalg import spsolve
import numpy as np

N = int(eval(input()))
A = np.array(input().split())
rows = np.concatenate([np.arange(N), np.arange(N)])
cols = np.concatenate([np.arange(N), np.arange(1, N + 1) % N])
mat = csr_matrix(([1] * (2 * N), (rows, cols)), (N, N))
answer = (spsolve(mat, A) * 2 + 0.5).astype(int)
print((*answer))

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N, *A = list(map(int, read().split()))
S = sum(A)
x = S // 2 - sum(A[1::2])
rain = [x + x]
for x in A[:-1]:
    rain.append(x + x - rain[-1])
print((" ".join(map(str, rain))))

-from scipy.sparse import csr_matrix -from scipy.sparse.linalg import spsolve -import numpy as np +import sys -N = int(eval(input())) -A = np.array(input().split()) -rows = np.concatenate([np.arange(N), np.arange(N)]) -cols = np.concatenate([np.arange(N), np.arange(1, N + 1) % N]) -mat = csr_matrix(([1] * (2 * N), (rows, cols)), (N, N)) -answer = (spsolve(mat, A) * 2 + 0.5).astype(int) -print((*answer)) +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines +N, *A = list(map(int, read().split())) +S = sum(A) +x = S // 2 - sum(A[1::2]) +rain = [x + x] +for x in A[:-1]: +    rain.append(x + x - rain[-1]) +print((" ".join(map(str, rain))))