#include //#include using namespace std; using ll = long long; using graph = vector>; #define rep(i, n) for (int i = 0; i < (int)(n); i++) vector dh = {-1,0,1,0,-1,1,1,-1}; vector dw = {0,1,0,-1,1,1,-1,-1}; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); vector t(7); rep(i, 7) cin >> t.at(i); int time = 6000; rep(i, 7) { time -= t.at(i); if (time>=0&&t.at(i)!=-1) cout << time << "\n"; else cout << -1 << "\n"; } return 0; }