#include using namespace std; #define ll long long #define all(x) x.begin(),x.end() #define rep(i,a,b) for(int i=a;i<=b;i++) #define rep_r(i,a,b) for(int i=a;i>=b;i--) #define each(a,x) for (auto& x : a) using pi = pair; using pl = pair; using vi = vector; using vl = vector; #define fi first #define se second #define sz(x) int(x.size()) #define so(x) sort(all(x)) #define so_r(x) sort(all(x),greater()) #define zero(x) memset(x,0,sizeof(x)) #define pb push_back #define lb lower_bound #define ub upper_bound const char nl = '\n'; int dx[4] = {1,-1,0,0}; int dy[4] = {0,0,1,-1}; int bit_cnt(int x){ return __builtin_popcount(x); } ll bex(ll a, ll b, ll mod = 1e9 + 7){ll res = 1LL; while(b){ if (b&1) res = res * a % mod; a = a * a % mod; b >>= 1;} return res;} template bool chmax(t&a,u b){if(a bool chmin(t&a,u b){if(b> n; rep(i,0,n) cin >> a[i]; vector> res; rep_r(i,n,3) { a[i-2] += a[i]; a[i] = 0; } bool ok = false; rep_r(i,2,0) { if (ok || a[i]){ ok = true; res.push_back({a[i], i}); } } if (!sz(res)){ cout << "0" << nl << "0"; } else { // rep(i,0,n) cout << a[i] << ' '; // cout << nl; reverse(all(res)); cout << res.back().second << nl; each(res,x) cout << x.first << ' '; } } int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); int t = 1; //cin >> t; while (t--){ solve(); } }