n = int(input()) As = [] a = 0 for i in range(n): b = int(input()) a = [1, -1][i % 2] * (b - a) As.append(a) lower = 1 upper = 10**18 for i, a in enumerate(As): if i % 4 < 2: # negative ai = x - a1 -> 1 <= x - a1 <= 10**18 # x - 10**18 <= a1 <= x - 1 lower = max(lower, a - 10**18) upper = min(upper, a - 1) else: # positive ai = x + ai -> 1 <= x + ai <= 10**18 # 1 - x <= ai <= 10**18 - x lower = max(lower, 1 - a) upper = min(upper, 10**18 - a) if lower > upper: print(-1) else: print(n + 1) a1 = lower print(a1) for i, a in enumerate(As): if i % 4 < 2: print(a - a1) else: print(a + a1)