def main(): n = int(input()) a = [1] for i in range(n): a.append(int(input()) - a[i] if i%2 == 0 else a[i] - int(input())) a0 = min([a[i] for i in range(n+1) if i % 4 == 0 or i%4 == 3]) a = list(map(lambda x: x + (1 - a0), a)) a1 = min([a[i] for i in range(n+1) if i % 4 == 1 or i%4 == 2]) if a1 < 1: print(-1) else: print(n+1) [print(i+1-a0) for i in a] if __name__ == "__main__": import sys import os if len(sys.argv) > 1: if sys.argv[1] == "-d": filename = "input1.txt" fd = os.open(filename, os.O_RDONLY) os.dup2(fd, sys.stdin.fileno()) main() else: main()