def main(X,A,N):

    for i in range(N-1):

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

    return X

N = int(input())

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

S = sum(A)

Aoddsum = sum(A[1:N:2])

X1 = S - 2*Aoddsum

X = [0]*N

X[0] = X1

main(X,A,N)

for x in X:

    print(x, end=" ")

def main(X,A,N):

    for i in range(N-1):

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

    return X

N = int(eval(input()))

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

S = sum(A)

Aoddsum = sum(A[1:N:2])

X1 = S - 2*Aoddsum

X = [0]*N

X[0] = X1

main(X,A,N)

print((" ".join(list(map(str, X)))))



def main(X, A, N):
    for i in range(N - 1):
        X[i + 1] = 2 * A[i] - X[i]
    return X


N = int(input())
A = list(map(int, input().split()))
S = sum(A)
Aoddsum = sum(A[1:N:2])
X1 = S - 2 * Aoddsum
X = [0] * N
X[0] = X1
main(X, A, N)
for x in X:
    print(x, end=" ")

def main(X, A, N):
    for i in range(N - 1):
        X[i + 1] = 2 * A[i] - X[i]
    return X


N = int(eval(input()))
A = list(map(int, input().split()))
S = sum(A)
Aoddsum = sum(A[1:N:2])
X1 = S - 2 * Aoddsum
X = [0] * N
X[0] = X1
main(X, A, N)
print((" ".join(list(map(str, X)))))

-N = int(input()) +N = int(eval(input())) -for x in X: -    print(x, end=" ") +print((" ".join(list(map(str, X)))))