The input consists of at most 10 test cases. For each test case, the first line contains an integer n indicating that there are n candy box operations(1 <= n <= 50000).
The following n lines describe the n operations.
Each operation contains three integers t, x and y( 0 <= |x|, |y| <= 109). The first integer t may be -1, 0, or 1.
If t equals -1, it means that a candy in the box with sweetness degree x and sourness degree y is eaten by the dog king.
If t equals 1, it means that a candy with sweetness degree x and sourness degree y is added to the candy box.
If t equals 0, it means that a dog with sweetness fondness degree x and sourness fondness degree y wants to know the maximal deliciousness degree of the candies in the box for him.
It is guaranteed that every candy is unique in the box.
The input ends by n = 0.