#include "iostream" using namespace std; int N; long long int num[100000]; long long int ans[100001]; int main() { cin >> N; for (int i = 0; i < N; i++) { cin >> num[i]; } ans[0] = 1; for (int i = 1; i < N + 1; i++) { if (i % 2 == 1) { ans[i] = num[i - 1] - ans[i - 1]; } else { ans[i] = ans[i - 1] - num[i - 1]; } if (ans[i] <= 0) { cout << "-1\n"; return 0; } } cout << N + 1 << "\n"; for (int i = 0; i < N + 1; i++) { cout << ans[i] << "\n"; } return 0; }