#include #include #include using namespace std; int main() { int d; cin >> d; vector a(d + 1), b; for (auto i = 0; i <= d; i++) { cin >> a[i]; } for (auto i = d; i >= 3; i--) { auto coef = a[i]; a[i] -= coef; a[i - 2] += coef; } int degree = 0; for (auto i = 0; i < a.size(); i++) { if (a[i] != 0) degree = i; b.push_back(a[i]); } cout << degree << endl; for (auto i = 0; i <= degree; i++) { cout << (i == 0 ? "" : " ") << b[i]; } cout << endl; return 0; }