#include using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int T = 6000; for(int i=0; i<7; i++){ int t; cin >> t; if(t == -1) T = -1; else T -= t; if(T < 0) cout << "-1\n"; else cout << T << "\n"; } }