def main(): n = int(input()) a = [1] for i in range(n): add = int(input()) - a[i] if i%2 == 0 else a[i] - int(input()) if add >= 1: a.append(add) else: break if len(a) != n+1: print(-1) else: print(n+1) [print(i) 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()