using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; class TEST{ static void Main(){ Sol mySol =new Sol(); mySol.Solve(); } } class Sol{ public void Solve(){ long lmin = 1; long rmax = (long)1e18; long l,r,c; l = lmin; r = rmax+1; while(r-l>0){ c = (l+r)/2; long[] A = new long[N+1]; A[0] = c; int of = 0; long sig = 1; for(int i=1;i<=N;i++){ A[i] = (B[i-1]-A[i-1])*sig; if(A[i] > rmax){ of = 1; break; } if(A[i] < lmin){ of = -1; break; } sig *= -1; } //Console.WriteLine("c:{0},of:{1}",c,of); if(of == 0){ Console.WriteLine(N+1); Console.WriteLine(String.Join("\n",A)); return; } if(of == 1){ l = c; }else{ r = c; } } Console.WriteLine(-1); } int N; long[] B; public Sol(){ N = ri(); B = new long[N]; for(int i=0;iint.Parse(e));} static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));} static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));} }