def main():

    N = int(input())

    A = input().split()

    S = 0

    ans = []

    for n in range(N):

        ans.append(0)

        A[n] = int(A[n])

        S += A[n]

    ans[0] = S

    for n in range(N)[1::2]:

        ans[0] -= 2 * A[n]

    for n in range(N)[1:]:

        ans[n] = 2 * A[n - 1] - ans[n - 1]

    for n in range(N):

        if n == N - 1:

            print(ans[n])

        else:

            print(str(ans[n]) + " ", end="")



if __name__ == '__main__':

    main()

def main():

    N = int(input())

    A = input().split()

    S = 0

    for n in range(N):

        A[n] = int(A[n])

        S += A[n]

    ans = S

    for n in range(N)[1::2]:

        ans -= 2 * A[n]

    prev = ans

    print(str(ans) + " ", end="")

    for n in range(N)[1:]:

        ans = 2 * A[n - 1] - prev

        prev = ans

        if n == N - 1:

            print(ans)

        else:

            print(str(ans) + " ", end="")



if __name__ == '__main__':

    main()

def main():
    N = int(input())
    A = input().split()
    S = 0
    ans = []
    for n in range(N):
        ans.append(0)
        A[n] = int(A[n])
        S += A[n]
    ans[0] = S
    for n in range(N)[1::2]:
        ans[0] -= 2 * A[n]
    for n in range(N)[1:]:
        ans[n] = 2 * A[n - 1] - ans[n - 1]
    for n in range(N):
        if n == N - 1:
            print(ans[n])
        else:
            print(str(ans[n]) + " ", end="")


if __name__ == "__main__":
    main()

def main():
    N = int(input())
    A = input().split()
    S = 0
    for n in range(N):
        A[n] = int(A[n])
        S += A[n]
    ans = S
    for n in range(N)[1::2]:
        ans -= 2 * A[n]
    prev = ans
    print(str(ans) + " ", end="")
    for n in range(N)[1:]:
        ans = 2 * A[n - 1] - prev
        prev = ans
        if n == N - 1:
            print(ans)
        else:
            print(str(ans) + " ", end="")


if __name__ == "__main__":
    main()

-    ans = [] -        ans.append(0) -    ans[0] = S +    ans = S -        ans[0] -= 2 * A[n] +        ans -= 2 * A[n] +    prev = ans +    print(str(ans) + " ", end="") -        ans[n] = 2 * A[n - 1] - ans[n - 1] -    for n in range(N): +        ans = 2 * A[n - 1] - prev +        prev = ans -            print(ans[n]) +            print(ans) -            print(str(ans[n]) + " ", end="") +            print(str(ans) + " ", end="")