N = int(eval(input()))

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



X = [0]*N

# 全体の和 - 偶数の和*2 = 一番目の値

# もしくは、(x/2)+(y/2)=A, ..B,..C -> x+y+z = A+B+C

X[0] = sum(A) - sum(A[1::2])*2



#最初の値から順番にダムの値を引けば答え

for i in range(1, N):

  X[i] = A[i-1]*2 - X[i-1]

  

print((*X))  


def resolve():

    N = int(eval(input()))

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



    ans = [0] * N

    ans[0] = sum(A)



    for i in range(1, N, 2):

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



    for i in range(N - 1):

        ans[i + 1] = 2 * A[i] - ans[i]



    print((*ans))





if __name__ == "__main__":

    resolve()
N = int(eval(input()))
A = list(map(int, input().split()))
X = [0] * N
# 全体の和 - 偶数の和*2 = 一番目の値
# もしくは、(x/2)+(y/2)=A, ..B,..C -> x+y+z = A+B+C
X[0] = sum(A) - sum(A[1::2]) * 2
# 最初の値から順番にダムの値を引けば答え
for i in range(1, N):
    X[i] = A[i - 1] * 2 - X[i - 1]
print((*X))

def resolve():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    ans = [0] * N
    ans[0] = sum(A)
    for i in range(1, N, 2):
        ans[0] -= 2 * A[i]
    for i in range(N - 1):
        ans[i + 1] = 2 * A[i] - ans[i]
    print((*ans))


if __name__ == "__main__":
    resolve()

-N = int(eval(input())) -A = list(map(int, input().split())) -X = [0] * N -# 全体の和 - 偶数の和*2 = 一番目の値 -# もしくは、(x/2)+(y/2)=A, ..B,..C -> x+y+z = A+B+C -X[0] = sum(A) - sum(A[1::2]) * 2 -# 最初の値から順番にダムの値を引けば答え -for i in range(1, N): -    X[i] = A[i - 1] * 2 - X[i - 1] -print((*X)) +def resolve(): +    N = int(eval(input())) +    A = list(map(int, input().split())) +    ans = [0] * N +    ans[0] = sum(A) +    for i in range(1, N, 2): +        ans[0] -= 2 * A[i] +    for i in range(N - 1): +        ans[i + 1] = 2 * A[i] - ans[i] +    print((*ans)) + + +if __name__ == "__main__": +    resolve()