Set
You have queries and an empty set. Each query is of the form:
ADD x
: Add x to the setERASE x
: Erase x from the setNTH n
: Output the n-th smallest number in the set (1-indexed)MIN
: Output the minimum value in the setMAX
: Output the maximum value in the set
Constraints
Common sense constraints should hold ().
Example 1
Input
5
ADD 1
ADD 2
NTH 2
MIN
MAX
Input
2
1
2
Comments