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); Console.WriteLine(a[0]); return; } if (D ==1) { Console.WriteLine(1); Console.WriteLine("{0} {1}", a[0], a[1]); return; } if (D == 2) { Console.WriteLine(2); Console.WriteLine("{0} {1} {2}", a[0], a[1], a[2]); return; } 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); } } }