#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define INF 1e9 #define PI acos(-1) typedef long long ll; int main() { int d; cin >> d; vectora(d+1); for (int i = 0; i <= d; i++)cin >> a[i]; for (int i = d; i >= 3; i--) { a[i - 2] += a[i]; } int num = 2; if (a[2] == 0)num--; if (a[1] == 0 && num == 1)num--; cout << num << endl; for (int i = 0; i <= num; i++) { if (i == num)cout << a[num] << endl; else cout << a[i] << " "; } return 0; }