#include using namespace std; typedef long long int64; int main() { int N; int64 B[100000]; cin >> N; int64 xs = 1; for(int i = 0; i < N; i++) { cin >> B[i]; if(i & 1) xs = xs - B[i]; else xs = B[i] - xs; if(xs <= 0) { cout << -1 << endl; return (0); } } cout << N + 1 << endl; int64 rev = 1; cout << rev << endl; for(int i = 0; i < N; i++) { if(i & 1) rev = rev - B[i]; else rev = B[i] - rev; cout << rev << endl; } }