#line 1 "main.cpp" #include using namespace std; #include using namespace atcoder; #line 3 "/home/WebP/kyopro/cp-library/lib/util.hpp" using namespace std; using ll = long long; using ld = long double; template using greater_queue = priority_queue,greater>; #define rep(i,s,n) for (int i = (s); i < (n); i++) #define rep1(i,s,n) for (int i = (s); i <= (n); i++) #define REP(i,n,s) for (int i = (n)-1; i >= s; i--) #define REP1(i,n,s) for (int i = (n); i >= s; i--) #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin(), (a).rend() inline void YesNo(const bool& b) { cout << (b ? "Yes\n" : "No\n"); } template constexpr int sz(const T& a) { return (int)a.size(); } template constexpr bool chmax(T& a, const T& b) { if (a >= b) return false; a = b; return true; } template constexpr bool chmin(T& a, const T& b) { if (a <= b) return false; a = b; return true; } #line 7 "main.cpp" void solve() { int n = 7; vector t(n); rep(i,0,n) cin >> t[i]; int rem = 6000; rep(i,0,n) { rem -= t[i]; if (rem < 0 || t[i] == -1) cout << -1 << endl; else cout << rem << endl; } } int main() { cin.tie(nullptr) -> sync_with_stdio(false); cout << fixed << setprecision(15); int t = 1; // cin >> t; for (int ti = 0; ti < t; ti++) solve(); return 0; }