import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] aa = new int[n+1]; for(int i=n;i>=0;i--){ aa[i]=sc.nextInt(); } if(n==2){ String g=""; for(int i=n;i>=0;i--){ g+=aa[i]+" "; } System.out.println(2); System.out.println(g.trim()); return; }else if(n==1){ String g=""; for(int i=n;i>=0;i--){ g+=aa[i]+" "; } System.out.println(1); System.out.println(g.trim()); return; }else if(n==0){ System.out.println(0); System.out.println(aa[0]); return; } for(int i=0;i<=n-3;i++){ int temp=aa[i]; aa[i]=0; aa[i+2]-=-1*temp; } if(aa[n-2]!=0){ System.out.println(2); System.out.println(aa[n]+" "+aa[n-1]+" "+aa[n-2]); return; }else if(aa[n-1]!=0){ System.out.println(1); System.out.println(aa[n]+" "+aa[n-1]); }else{ System.out.println(0); System.out.println(aa[n]); } } }