using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Text; using System.Text.RegularExpressions; using System.Linq; class Magatro { static void Main() { int D = int.Parse(Console.ReadLine()); int[] a = Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); if (D == 0) { Console.WriteLine("0\n0"); } if (D < 3) { Console.WriteLine(D); for(int i = 0; i < D; i++) { Console.Write(a[i]+" "); } Console.Write(a[D] + "\n"); } for(int i = D; i >=3; i--) { a[i - 2] += a[i]; a[i] = 0; } bool aa = false; string ans = ""; int DD=0; int aaa = a[0]; int bbb = a[1]; int ccc = a[2]; if (ccc == 0) { if (bbb == 0) { Console.WriteLine(0); Console.WriteLine(aaa); } else { Console.WriteLine(1); Console.WriteLine("{0} {1}", aaa, bbb); } } else { Console.WriteLine(2); Console.WriteLine("{0} {1} {2}", aaa, bbb, ccc); } } }