#include "bits/stdc++.h" using namespace std; #define ll long long #define vi vector #define vvi vector #define pi pair #define mp make_pair #define pb push_back #define MOD 1e9 + 7 #define PAI 3.1415 #define all(x) (x).begin(),(x).end() #define chmax(x,y) x = max(x,y) #define chmin(x,y) x = min(x,y) #define pr(x) cout << x << endl #define Endl endl #define rep(i,n) for(int i = 0 ; i < n; i++) const int dx[4] = {1,0,-1,0}; const int dy[4] = {0,1,0,-1}; const int ddx[8] = {-1,0,1,-1,1,-1,0,1}; const int ddy[8] = {-1,-1,-1,0,0,1,1,1}; const int inf = 99999999; const ll linf = 1LL << 62; ll gcd(ll a,ll b){ if(a < b)swap(a , b); if(a % b != 0) gcd(b, a%b); return b; } ll lcm(ll a,ll b){ if(a < b)swap(a , b); return (a/gcd(a , b)) * b; } int main(){ int d; cin >> d; vi v(10005); rep(i, d + 1) cin >> v[i]; for(int i = d; i >= 3; i--){ v[i - 2] -= -v[i]; v[i] = 0; } bool x2 = (v[2] != 0) ? true : false; bool x1 = (v[1] != 0) ? true : false; if(x2){ pr('2'); cout << v[0] << ' ' << v[1] << ' ' << v[2] << endl; } else if(!x2 and x1){ pr('1'); cout << v[0] << ' ' << v[1] << endl; } else{ pr('0'); pr(v[0]); } return 0; }