T = list(map(int, input().split())) ans = [] ng = False S = 0 for t in T: if t == -1: ng = True if ng:ans.append(-1) else: S+=t;ans.append(max(-1, 6000-S)) print(*ans)