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]) a1 = min([a[i] for i in range(n+1) if i % 4 == 1 or i%4 == 2]) if a1 < 1: print(-1) [print(i) for i in a] else: if a0 + a1 >= 2: print(n+1) [print(a[i]+1-a0) if i % 4 == 0 or i%4 == 3 else print(a[i] - 1 + a0) for i in range(len(a))] else: print(-1) 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()