#!/usr/bin/python2 # -*- coding: utf-8 -*- # † n = int(raw_input()) b = [int(raw_input()) for _ in xrange(n)] a = [1] + [None] * n for i in xrange(n): if i & 1: a[i+1] = a[i] - b[i] else: a[i+1] = b[i] - a[i] if any(x <= 0 for x in a): print -1 else: print len(a) print '\n'.join(map(str, a))