#include using namespace std; int main(){ int d; cin >> d; int a[11000]; 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" : " "); } }