#include using namespace std; int a[110]; int main(){ int d; cin >> d; for(int i = 0; i <= d; ++i) { cin >> a[i]; } for (int i = d; i >= 3; --i) { a[i - 2] += a[i]; } int q = 2; while (q >= 1 && a[q] == 0) q--; cout << q << endl; for(int i=0;i<=q;i++) { cout << a[i] << (i == q ? "\n" : " "); } }