PS: I first got the data in n and s.
Then, I just subtracted every element of s from their respective previous elements and put them in a. Lastly, I printed them out in the format provided.
n = int(input())
s = list(map(int, input().split()))
prev = s[0]
a = [prev]
for i in range(1,n):
prev = s[i-1]
a.append(s[i] - prev)
for aa in a:
print(aa, end = ' ')