N = int(input())

A = [int(i) for i in input().split()]

List = [0 for i in range(N)]

Sum = 0

for i in range(1,N-1,2):

    Sum += A[i]

List[0] = sum(A)-(2*Sum)

for i in range(1,N):

    List[i] = 2*A[i-1]-List[i-1]



for i in List:

    print(i,end=" ")

def main():

    n = int(eval(input()))

    a = [int(i) for i in input().split()]

    s = sum(a)

    s1 = 0

    for i in range(1,n,2):

        s1 += a[i]

    x1 = s-2*(s1)

    ans = [x1]

    for i in range(n-1):

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

    print((*ans))

    

main()
N = int(input())
A = [int(i) for i in input().split()]
List = [0 for i in range(N)]
Sum = 0
for i in range(1, N - 1, 2):
    Sum += A[i]
List[0] = sum(A) - (2 * Sum)
for i in range(1, N):
    List[i] = 2 * A[i - 1] - List[i - 1]
for i in List:
    print(i, end=" ")

def main():
    n = int(eval(input()))
    a = [int(i) for i in input().split()]
    s = sum(a)
    s1 = 0
    for i in range(1, n, 2):
        s1 += a[i]
    x1 = s - 2 * (s1)
    ans = [x1]
    for i in range(n - 1):
        ans.append(2 * a[i] - ans[-1])
    print((*ans))


main()

-N = int(input()) -A = [int(i) for i in input().split()] -List = [0 for i in range(N)] -Sum = 0 -for i in range(1, N - 1, 2): -    Sum += A[i] -List[0] = sum(A) - (2 * Sum) -for i in range(1, N): -    List[i] = 2 * A[i - 1] - List[i - 1] -for i in List: -    print(i, end=" ") +def main(): +    n = int(eval(input())) +    a = [int(i) for i in input().split()] +    s = sum(a) +    s1 = 0 +    for i in range(1, n, 2): +        s1 += a[i] +    x1 = s - 2 * (s1) +    ans = [x1] +    for i in range(n - 1): +        ans.append(2 * a[i] - ans[-1]) +    print((*ans)) + + +main()