#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define endl '\n' #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() #define uniq(v) (v).erase(unique((v).begin(), (v).end()), (v).end()) typedef long long ll; typedef pair P; typedef unsigned int uint; typedef unsigned long long ull; struct pairhash { public: template size_t operator()(const pair &x) const { size_t seed = hash()(x.first); return hash()(x.second) + 0x9e3779b9 + (seed<<6) + (seed>>2); } }; const int inf = 1000000009; const double eps = 1e-8; int main() { /* ios::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(15); */ int d; scanf("%d", &d); int as[d+1]; int poly[4] = {1, 0, -1, 0}; for (int i = 0; i <= d; i++) scanf("%d", &as[i]); if (d <= 2) { printf("%d\n", d); for (int i = 0; i < d; i++) printf("%d ", as[i]); printf("%d\n", as[d]); } else { for (int i = d; i >= 3; i--) { int a = as[i]; for (int j = 0; j < 4; j++) { as[i-j] -= a * poly[j]; } } int rd = 2; for (int i = 2; i >= 0; i--) if (as[i] == 0) rd = i-1; printf("%d\n", max(0, rd)); for (int i = 0; i < rd; i++) printf("%d ", as[i]); printf("%d\n", as[max(0, rd)]); } }