d = int(input()) array = list(map(int, input().split())) c = array[0] f_1 = sum(array) f_2 = 0 for i in range(d+1): if i % 2 == 0: f_2 += array[i] else: f_2 -= array[i] a = ((f_1+f_2) - 2*c)//2 for b in range(-1000000, 1000000): if a+b+c == f_1 and a-b+c == f_2: d = 3 if a == 0: d -= 1 if b == 0: d -= 1 if c == 0: d -= 1 if d == 0: print(0) print(0) exit() print(d-1) for i in range(d): print([c,b,a][i], end=" ") exit()