import java.io.*; import java.util.StringTokenizer; class Main{ static final PrintWriter out=new PrintWriter(System.out); public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; while((line=br.readLine())!=null&&!line.isEmpty()){ int d=Integer.parseInt(line); int[] a=new int[d+1]; StringTokenizer st=new StringTokenizer(br.readLine()); for(int i=0;i<=d;i++) a[i]=Integer.parseInt(st.nextToken()); if(d==0||d==1||d==2){ out.println(d); if(d==0) out.println(a[0]); if(d==1) out.printf("%d %d\r\n",a[0],a[1]); if(d==2) out.printf("%d %d %d\r\n",a[0],a[1],a[2]); out.flush(); continue; } for(int i=d;i>=3;i--) a[i-2]+=a[i]; int dd=a[2]==0?a[1]==0?0:1:2; out.println(dd); if(dd==0) out.println(a[0]); if(dd==1) out.printf("%d %d\r\n",a[0],a[1]); if(dd==2) out.printf("%d %d %d\r\n",a[0],a[1],a[2]); out.flush(); } } }