using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Numerics; using BI = System.Numerics.BigInteger; class TEST{ static void Main(){ Sol mySol =new Sol(); mySol.Solve(); } } class Sol{ public void Solve(){ BI lmin = 1; BI rmax = (BI)1e18; BI[] A = new BI[N+1]; A[0] = 0; BI sig = 1; for(int i=1;i<=N;i++){ A[i] = (B[i-1] - A[i-1]) * sig; sig *= -1; } BI ll = lmin; BI rr = rmax; for(int i=0;i<=N;i++){ if(i%4 == 0 || i%4 == 3){ if(A[i]+rr > rmax) rr -= (A[i] + rr - rmax); if(A[i]+ll < lmin) ll += (lmin - (A[i] + ll)); }else{ if(A[i]-rr < lmin) rr -= (lmin - (A[i] - rr)); if(A[i]-ll > rmax) ll += ((A[i] - ll) - rmax); } } if(lmin <= ll && ll <= rr && rr <= rmax){ A[0] = ll; sig = 1; for(int i=1;i<=N;i++){ A[i] = (B[i-1] - A[i-1]) * sig; sig *= -1; } Console.WriteLine(N+1); Console.WriteLine(String.Join("\n",A)); return; } Console.WriteLine(-1); } int N; BI[] B; public Sol(){ N = ri(); B = new BI[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));} }