Simple Input Problm

Could you please tell me the approach to solve this.
I am not getting how to start this question.

Basically in this question you have to maintain a variable called sum, and you have to processed the nos and print the nos, uptil that point when sum >=0,
and as soon as sum becomes less than 0 or negative, stop processing