def main():

    n = int(eval(input()))

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



    s = 0

    for i in range(n-1):

        s += (-1)**(i+1)*a[i]

    x = (a[n-1]-s)//2

    ans = [x]

    for i in range(n-1):

        ans.append(a[i]-ans[i])

    print((' '.join(list(map(str,list([2*x for x in ans]))))))



if __name__ == "__main__":

    main()
def main():

    n = int(eval(input()))

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

    x = 0

    for i in range(n):

        x = x + a[i]*(-1)**i

    ans = [x//2]

    for i in range(n-2):

        ans.append(a[i]-ans[-1])

    ans.append(a[n-1]-ans[0])

    for i in range(n):

        ans[i] = ans[i]*2

    print((' ' .join(list(map(str,ans)))))



if __name__ == "__main__":

    main()

def main():
    n = int(eval(input()))
    a = list(map(int, input().split()))
    s = 0
    for i in range(n - 1):
        s += (-1) ** (i + 1) * a[i]
    x = (a[n - 1] - s) // 2
    ans = [x]
    for i in range(n - 1):
        ans.append(a[i] - ans[i])
    print((" ".join(list(map(str, list([2 * x for x in ans]))))))


if __name__ == "__main__":
    main()

def main():
    n = int(eval(input()))
    a = list(map(int, input().split()))
    x = 0
    for i in range(n):
        x = x + a[i] * (-1) ** i
    ans = [x // 2]
    for i in range(n - 2):
        ans.append(a[i] - ans[-1])
    ans.append(a[n - 1] - ans[0])
    for i in range(n):
        ans[i] = ans[i] * 2
    print((" ".join(list(map(str, ans)))))


if __name__ == "__main__":
    main()

-    s = 0 -    for i in range(n - 1): -        s += (-1) ** (i + 1) * a[i] -    x = (a[n - 1] - s) // 2 -    ans = [x] -    for i in range(n - 1): -        ans.append(a[i] - ans[i]) -    print((" ".join(list(map(str, list([2 * x for x in ans])))))) +    x = 0 +    for i in range(n): +        x = x + a[i] * (-1) ** i +    ans = [x // 2] +    for i in range(n - 2): +        ans.append(a[i] - ans[-1]) +    ans.append(a[n - 1] - ans[0]) +    for i in range(n): +        ans[i] = ans[i] * 2 +    print((" ".join(list(map(str, ans)))))