#include using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); vector a(7); rep(i, 7) cin >> a[i]; rep(i, 7) { ll s = 0; rep(j, i + 1) { if (a[j] != -1) s += a[j]; else s += 1 << 30; } if (s <= 6000) cout << 6000 - s << endl; else cout << -1 << endl; } return 0; }