import java.io.PrintStream; import java.util.Scanner; public class Y451 { Scanner in = new Scanner(System.in); PrintStream out = new PrintStream(System.out); Y451() throws Exception { int n = in.nextInt(); long[] b = new long[n]; for (int i = 0; i < n; i++) { b[i] = in.nextLong(); } long[] a = new long[n+1]; final long INF = 1000_000_000__000_000_000L; a[0] = 1; for (int i = 0; i < n; i++) { if (i % 2 == 0) { a[i+1] = b[i] - a[i]; } else { a[i+1] = a[i] - b[i]; } } for (int i = 1; i <= n; i++) { if (a[i] < 1 && (i % 4 == 0 || i % 4 == 3)) { a[0] = Math.max(a[0], -a[i] + 1); } if (a[i] > INF && (i % 4 == 1 || i % 4 == 2)) { a[0] = Math.max(a[0], a[i] - INF + 1); } } for (int i = 0; i < n; i++) { if (i % 2 == 0) { a[i+1] = b[i] - a[i]; } else { a[i+1] = a[i] - b[i]; } } for (int i = 0; i <= n; i++) { if (a[i] < 1 || INF < a[i]) { out.println(-1); return; } } out.println(n+1); for (int i = 0; i <= n; i++) { out.println(a[i]); } } public static void main(String argv[]) throws Exception { new Y451(); } }