The first line of the input contains a positive integer n, specifying the number of operations performed by Byteasar. The next n lines contain descriptions of operations, one per line, each being an integer Ai(-n<=Ai<=N,Ai<>0) ). If Ai>0, then it specifies an editing operation which modifies the editor state to Ai. If Ai<0, then it specifies an undo operation of level -Ai. You can assume that for every undo operation there will be some operation in the state active of smaller level to undo.