def mul(inp):

    return int(inp * 2)





if __name__ == '__main__':

    n = int(eval(input()))

    a = list(map(mul, list(map(int, input().split()))))

    res = [0] * n

    for x in range(0, 1):

        res[x] = a[x]

        count = 1

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

            mod_i = i % n

            res[x] = res[x] - a[mod_i]

        for i in range(x + 2, n + x, 2):

            mod_i = i % n

            res[x] = res[x] + a[mod_i]

        res[x] = int(res[x] / 2)

    for x in range(1, n):

        res[x] = a[x - 1] - res[x - 1]

    print((' '.join(map(str, res))))

from functools import reduce

from operator import add





def mul(inp):

    return int(inp * 2)





if __name__ == '__main__':

    n = int(eval(input()))

    a = list(map(mul, list(map(int, input().split()))))

    res = [0] * n

    minus = reduce(add, [a[i] for i in range(1, n, 2)])

    plus = reduce(add, [a[i] for i in range(2, n, 2)])

    res[0] = int((a[0] + plus - minus) / 2)

    for x in range(1, n):

        res[x] = a[x - 1] - res[x - 1]

    print((' '.join(map(str, res))))

def mul(inp):
    return int(inp * 2)


if __name__ == "__main__":
    n = int(eval(input()))
    a = list(map(mul, list(map(int, input().split()))))
    res = [0] * n
    for x in range(0, 1):
        res[x] = a[x]
        count = 1
        for i in range(x + 1, n + x, 2):
            mod_i = i % n
            res[x] = res[x] - a[mod_i]
        for i in range(x + 2, n + x, 2):
            mod_i = i % n
            res[x] = res[x] + a[mod_i]
        res[x] = int(res[x] / 2)
    for x in range(1, n):
        res[x] = a[x - 1] - res[x - 1]
    print((" ".join(map(str, res))))

from functools import reduce
from operator import add


def mul(inp):
    return int(inp * 2)


if __name__ == "__main__":
    n = int(eval(input()))
    a = list(map(mul, list(map(int, input().split()))))
    res = [0] * n
    minus = reduce(add, [a[i] for i in range(1, n, 2)])
    plus = reduce(add, [a[i] for i in range(2, n, 2)])
    res[0] = int((a[0] + plus - minus) / 2)
    for x in range(1, n):
        res[x] = a[x - 1] - res[x - 1]
    print((" ".join(map(str, res))))

+from functools import reduce +from operator import add + + -    for x in range(0, 1): -        res[x] = a[x] -        count = 1 -        for i in range(x + 1, n + x, 2): -            mod_i = i % n -            res[x] = res[x] - a[mod_i] -        for i in range(x + 2, n + x, 2): -            mod_i = i % n -            res[x] = res[x] + a[mod_i] -        res[x] = int(res[x] / 2) +    minus = reduce(add, [a[i] for i in range(1, n, 2)]) +    plus = reduce(add, [a[i] for i in range(2, n, 2)]) +    res[0] = int((a[0] + plus - minus) / 2)