import sys

def input(): return sys.stdin.readline().rstrip()

def main():

    n=int(eval(input()))

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

    B=[0]*n

    B[0]=sum(A)-sum(A[1::2])*2

    for i in range(1,n):

        B[i]=(A[i-1]-B[i-1]//2)*2

    print((*B))

    

if __name__=='__main__':

    main()
import sys

def input(): return sys.stdin.readline().rstrip()

def main():

    n=int(eval(input()))

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

    B=[0]*n

    B[0]=sum(A)-sum(A[1::2])*2

    for i in range(1,n):

        B[i]=(A[i-1]-B[i-1]//2)*2

    print((*B))

    

if __name__=='__main__':

    main()
import sys


def input():
    return sys.stdin.readline().rstrip()


def main():
    n = int(eval(input()))
    A = [int(_) for _ in input().split()]
    B = [0] * n
    B[0] = sum(A) - sum(A[1::2]) * 2
    for i in range(1, n):
        B[i] = (A[i - 1] - B[i - 1] // 2) * 2
    print((*B))


if __name__ == "__main__":
    main()

import sys


def input():
    return sys.stdin.readline().rstrip()


def main():
    n = int(eval(input()))
    A = list(map(int, input().split()))
    B = [0] * n
    B[0] = sum(A) - sum(A[1::2]) * 2
    for i in range(1, n):
        B[i] = (A[i - 1] - B[i - 1] // 2) * 2
    print((*B))


if __name__ == "__main__":
    main()

-    A = [int(_) for _ in input().split()] +    A = list(map(int, input().split()))