diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -2,6 +2,6 @@
 S = list(map(int, input().split()))
 A = [S[0]]
 for i in range(1, N):
-    a = S[i] - A[-1]
+    a = S[i] - S[i - 1]
     A.append(a)
 print(*A)
