a['~~'];i;main(d){for(scanf("%d",&d);~scanf("%d",a+i++););for(;--i>2;)a[i-2]+=a[i];printf("%d\n",a[2]?2:a[1]?1:0); a[2]?printf("%d %d %d",a[0],a[1],a[2]):a[1]?printf("%d %d",a[0],a[1]):printf("%d",a[0]);}