#include #include #include using namespace std; int main() { int t[7]; for (int i = 0; i < 7; ++i) cin >> t[i]; int nok = 6000; for (int i = 0; i < 7; ++i) { if (t[i] == -1 || nok < t[i]) { nok = -2; cout << "-1\n"; } else { nok -= t[i]; cout << nok << '\n'; } } }