def main():

    import sys

    input = sys.stdin.readline

    n = int(input().rstrip('\n'))

    a = list(map(int, input().rstrip('\n').split()))

    b = [sum(a) - sum(a[1::2]) * 2]

    for i in range(len(a)-1):

        b.append((a[i] - b[i] // 2) * 2)

    print((*b))





if __name__ == '__main__':

    main()

def slove():

    import sys

    input = sys.stdin.readline

    n = int(input().rstrip('\n'))

    a = list(map(int, input().rstrip('\n').split()))

    ts = sum(a) - sum(a[1::2]) * 2

    ls = [0] * n

    ls[0] = ts

    for i in range(1, n):

        ls[i] = (a[i-1] - ls[i-1] // 2) * 2

    print((*ls))





if __name__ == '__main__':

    slove()

def main():
    import sys

    input = sys.stdin.readline
    n = int(input().rstrip("\n"))
    a = list(map(int, input().rstrip("\n").split()))
    b = [sum(a) - sum(a[1::2]) * 2]
    for i in range(len(a) - 1):
        b.append((a[i] - b[i] // 2) * 2)
    print((*b))


if __name__ == "__main__":
    main()

def slove():
    import sys

    input = sys.stdin.readline
    n = int(input().rstrip("\n"))
    a = list(map(int, input().rstrip("\n").split()))
    ts = sum(a) - sum(a[1::2]) * 2
    ls = [0] * n
    ls[0] = ts
    for i in range(1, n):
        ls[i] = (a[i - 1] - ls[i - 1] // 2) * 2
    print((*ls))


if __name__ == "__main__":
    slove()

-def main(): +def slove(): -    b = [sum(a) - sum(a[1::2]) * 2] -    for i in range(len(a) - 1): -        b.append((a[i] - b[i] // 2) * 2) -    print((*b)) +    ts = sum(a) - sum(a[1::2]) * 2 +    ls = [0] * n +    ls[0] = ts +    for i in range(1, n): +        ls[i] = (a[i - 1] - ls[i - 1] // 2) * 2 +    print((*ls)) -    main() +    slove()