#include #include #include using namespace std; using ll = long long; int main(void){ int mx=6000, now=0; for(int i=0; i<7; i++){ int t; cin >> t; if(t==-1){ cout << -1 << endl; continue; } now+=t; if(now>mx) cout << -1 << endl; else cout << mx-now << endl; } return 0; }