#include using namespace std; using ll = long long; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b void vprint(T &V){ for(auto v : V){ cout << v << " "; } cout << endl; } int main(){ cin.tie(0); ios::sync_with_stdio(false); // input ll D; cin >> D; D++; vector B(D); FOR(i, 0, D){ cin >> B.at(i); } reverse(ALL(B)); FOR(i, 0, D-3){ B[i+2] += B[i]; B[i] = 0; } // vprint(B); if(B[D-3]!=0){ p(2); cout << B[D-1] << ' ' << B[D-2] << ' ' << B[D-3] << endl; } else if(B[D-2]!=0){ p(1); cout << B[D-1] << ' ' << B[D-2] << endl; } else{ p(0); p(B[D-1]); } return 0; }