1) Get the input of an integer N and a sequence S
2) We have to subtract every element of sequence S from each of the previous elements and put them in to variable A
3) Use a For loop in a range of 1 to N, sequence S's 0th place should change to sequence S's i-1th place
4) S[0] has changed into S[i-1], so now we can use 'append' to get the our sequence
5) Repeat this N times
6) Print the sequence A in the format provided
N = int(input())
S = list(map(int,input().split()))
A = [S[0]]
for i in range(1,N):
S[0] = S[i-1]
A.append(S[i]-S[0])
for i in A:
print(i, end=' ')