# a2 = b1 - a1 # a3 = a2 - b2 = - b2 + b1 - a1 # a4 = b3 - a3 = b3 + b2 - b1 + a1 # a5 = a4 - b4 = -b4 + b3 + b2 - b1 + a1 # a6 = b5 - a5 import sys input = sys.stdin.readline N = int(input()) ans = [0] * N v = 0 now = 0 for i in range(N): b = int(input()) if i % 2: now = now - b else: now = b - now ans[i] = now if 2 <= i % 4 <= 3: v = min(v, now - 1) a = max(1, -v) for i in range(N): if i % 4 <= 1: ans[i] -= a else: ans[i] += a if ans[i] <= 0: print(-1) exit() print(N + 1) print(a) for a in ans: print(a)