import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines

sys.setrecursionlimit(10000000)

from itertools import accumulate

def main():

    N = int(readline())

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

    Ae = A[1::2]

    Ao = A[::2]

    x1 = (sum(Ao)-sum(Ae))//2

    table = [0]*(N+1)

    table[0] = x1

    def rec(i):

        if i == N:

            return

        table[i+1] = A[i] - table[i]

        rec(i+1)

    rec(0)

    for i in table[:N]:

        print(i*2, end=' ')

if __name__ == '__main__':

    main()

import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines

sys.setrecursionlimit(10000000)

def main():

    N = int(readline())

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

    Ae = A[1::2]

    Ao = A[::2]

    x1 = (sum(Ao)-sum(Ae))//2

    table = [0]*(N+1)

    table[0] = x1

    for i in range(N):

        table[i+1] = A[i] - table[i]



    for i in table[:N]:

        print(i*2, end=' ')

if __name__ == '__main__':

    main()

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10000000)
from itertools import accumulate


def main():
    N = int(readline())
    A = [int(i) for i in readline().split()]
    Ae = A[1::2]
    Ao = A[::2]
    x1 = (sum(Ao) - sum(Ae)) // 2
    table = [0] * (N + 1)
    table[0] = x1

    def rec(i):
        if i == N:
            return
        table[i + 1] = A[i] - table[i]
        rec(i + 1)

    rec(0)
    for i in table[:N]:
        print(i * 2, end=" ")


if __name__ == "__main__":
    main()

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10000000)


def main():
    N = int(readline())
    A = [int(i) for i in readline().split()]
    Ae = A[1::2]
    Ao = A[::2]
    x1 = (sum(Ao) - sum(Ae)) // 2
    table = [0] * (N + 1)
    table[0] = x1
    for i in range(N):
        table[i + 1] = A[i] - table[i]
    for i in table[:N]:
        print(i * 2, end=" ")


if __name__ == "__main__":
    main()

-from itertools import accumulate - -    def rec(i): -        if i == N: -            return +    for i in range(N): -        rec(i + 1) - -    rec(0)