#include using namespace std; int main(){ int n; cin >> n; if(n == 1){ int b; cin >> b; if(b == 1){ cout << -1 << endl; return 0; } cout << 2 << endl; cout << 1 << endl; cout << b-1 << endl; return 0; } int *a = new int[n+2], *b = new int[n+1]; for (int j = 1; j <= n; ++j) cin >> b[j]; int flag = 1; for(a[2] = b[2] + 1; a[2] < b[1]; ++a[2]){ flag = 1; a[1] = b[1] - a[2]; a[3] = a[2] - b[2]; int i = 3; for (; i <= n && flag; ++i){ if(i%2 == 1){ a[i+1] = b[i] - a[i]; } else { a[i+1] = a[i] - b[i]; } flag = a[i+1] >= 1; } if(flag) break; } if(flag){ cout << n+1 << endl; for(int i = 1; i <= n+1; i++){ cout << a[i] << endl; } } else { cout << -1 << endl; } return 0; }