#include using namespace std; #define rep(i,n) for(int (i) = 0 ; (i) < (int)(n) ; (i)++) #define REP(i,a,b) for(int (i) = a ; (int)(i) <= (int)(b) ; (i)++) #define all(n) (n).begin(),(n).end() typedef vector Vi; typedef vector VVi; typedef pair Pii; typedef vector VPii; vector norm(vector a){ while( a.size() && a.back() == 0 ) a.pop_back(); return a; } vector polyDiv(vector a,vector b){ a = norm(a); b = norm(b); vector res; vector r(max(a.size(),b.size())+1); while( a.size() >= b.size() ){ int coef = a.back() / b.back(); rep(i,b.size()){ a[a.size()-b.size()+i] -= b[i] * coef; } a = norm(a); } return a; } int main(){ int D; cin >> D; Vi a(D+1); for(int i = 0 ; i <= D ; i++) cin >> a[i]; auto res = polyDiv(a,{0,-1,0,1}); if( res.size() == 0 ){ cout << 0 << endl; cout << 0 << endl; }else{ cout << res.size() - 1 << endl; for(int i = 0 ; i < res.size() ; i++) cout << res[i] << (i+1==res.size()?"\n":" "); } }