PROGRAMMING:Trap template questions
This is a board problem of Treap. You need to implement the following operations:
one Insert number x
two Delete number x (if there are multiple identical numbers, only one will be deleted)
three Query the ranking of X (the ranking is defined as the number of numbers smaller than the current number + 1). If there are more than one same number, the lowest ranking will be output.)
four Number of queries ranked x
five Find the precursor of X (the precursor is defined as the largest number less than x)
six Find the successor of X (the successor is defined as the smallest number greater than x)
###Input format:
The first line n represents the number of operations. In the following N lines, each line has two numbers opt and X. opt represents the sequence number of operations (1 ≤ opt ≤ 6). The data range is: 1 ≤ n ≤$$10 ^ 5 $$, − $$10 ^ 7 $$≤ x ≤$$10 ^ 7$$
###Output format:
For operations 3, 4, 5 and 6, output a number in each line to indicate the corresponding answer
###Input example:
Here is a set of inputs. For example:
```in
ten
one one hundred and six thousand four hundred and sixty-five
four one
one three hundred and seventeen thousand seven hundred and twenty-one
one four hundred and sixty thousand nine hundred and twenty-nine
one six hundred and forty-four thousand nine hundred and eighty-five
one eighty-four thousand one hundred and eighty-five
one eighty-nine thousand eight hundred and fifty-one
six eighty-one thousand nine hundred and sixty-eight
one four hundred and ninety-two thousand seven hundred and thirty-seven
five four hundred and ninety-three thousand five hundred and ninety-eight
```
###Output example:
The corresponding output is given here. For example:
```out
one hundred and six thousand four hundred and sixty-five
eighty-four thousand one hundred and eighty-five
four hundred and ninety-two thousand seven hundred and thirty-seven
```
answer:If there is no answer, please comment
one Insert number x
two Delete number x (if there are multiple identical numbers, only one will be deleted)
three Query the ranking of X (the ranking is defined as the number of numbers smaller than the current number + 1). If there are more than one same number, the lowest ranking will be output.)
four Number of queries ranked x
five Find the precursor of X (the precursor is defined as the largest number less than x)
six Find the successor of X (the successor is defined as the smallest number greater than x)
###Input format:
The first line n represents the number of operations. In the following N lines, each line has two numbers opt and X. opt represents the sequence number of operations (1 ≤ opt ≤ 6). The data range is: 1 ≤ n ≤$$10 ^ 5 $$, − $$10 ^ 7 $$≤ x ≤$$10 ^ 7$$
###Output format:
For operations 3, 4, 5 and 6, output a number in each line to indicate the corresponding answer
###Input example:
Here is a set of inputs. For example:
```in
ten
one one hundred and six thousand four hundred and sixty-five
four one
one three hundred and seventeen thousand seven hundred and twenty-one
one four hundred and sixty thousand nine hundred and twenty-nine
one six hundred and forty-four thousand nine hundred and eighty-five
one eighty-four thousand one hundred and eighty-five
one eighty-nine thousand eight hundred and fifty-one
six eighty-one thousand nine hundred and sixty-eight
one four hundred and ninety-two thousand seven hundred and thirty-seven
five four hundred and ninety-three thousand five hundred and ninety-eight
```
###Output example:
The corresponding output is given here. For example:
```out
one hundred and six thousand four hundred and sixty-five
eighty-four thousand one hundred and eighty-five
four hundred and ninety-two thousand seven hundred and thirty-seven
```
answer:If there is no answer, please comment