Problem

9 /10


Number game

Problem

Games with numbers for Deniska and Mishka have become the most favorite. Now they play like this. 
Deniska gives Mishka the following commands:
1) remember a - after this command Mishka must remember the next number a
2) forget a - after this command, Mishka forgets that the number a was (Deniska always says the number a, which was exactly before)
The game continues for a certain number of steps, which is agreed in advance. After all the steps, the Bear must name in ascending order all the unique numbers that he remembered.

Input
The input is the number N (\(1 <= N <= 100000\)) - the number of steps in the game . The following N lines contain  commands in the following format:
character ‘+’ (remember number) or ‘-’ (forget the number) followed by a space separated number a (\(1 <= a <= 1000000000\)).
It is guaranteed that if the number a needs to be forgotten, then it has already been encountered with the command '+' and not forgotten. 

Imprint
It is required to display all unique numbers (in ascending order) that Mishka eventually remembered after executing all requests or -1 if there were no such numbers in the end.
 
Examples
# Input Output
1
3
+1
+2
-1
2
2
3
+1
+1
-1
-1
3
3
+1
+1
+1
1