#include using namespace std; using ll = long long; #define rep(i, s, e) for (int i = (int)s; i < (int)e; ++i) #define all(a) (a).begin(), (a).end() int main() { cin.tie(nullptr); int D; cin >> D; vector a(D + 1); rep(i, 0, D + 1) cin >> a[i]; reverse(all(a)); rep(i, 0, D - 2) a[i + 2] += a[i]; reverse(all(a)); if (a[0] == 0 && a[1] == 0 && a[2] == 0) { cout << 0 << '\n' << 0 << '\n'; } else if (a[1] == 0 && a[2] == 0) { cout << 0 << '\n'; cout << a[0] << '\n'; } else if (a[2] == 0) { cout << 1 << '\n'; cout << a[0] << ' ' << a[1] << '\n'; } else { cout << 2 << '\n'; cout << a[0] << ' ' << a[1] << ' ' << a[2] << '\n'; } }