#include using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(0); int v = 0, sv = 0; for(int i = 0; i < 7; i++){ cin >> v; sv += (v == -1 ? 6001 : v); cout << max(-1, 6000 - sv) << '\n'; } }