#define _USE_MATH_DEFINES #define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include #include #include #include #include #include #include #include #include #include //#include using namespace std; int main() { int n; cin >> n; vectorx; for (int i = 0; i <= n; i++) { int a; cin >> a; x.push_back(a); } if (n<= 2) { for (int i = 0; i < n; i++) { if (i)cout << " "; cout << x[i]; }cout << endl; return 0; } for (int i = n; i > 2; i--) { x[i - 2] += x[i]; } for (int j = 2; j >= 0; j--) { if (x[j]) { cout << j << endl; for (int i = j; i >= 0; i--) { cout << x[i]; if (i)cout << " "; } return 0; } } cout << 0 << endl << 0 << endl; return 0; }