- Time limit: 1.00 s
- Memory limit: 512 MB
Your task is to efficiently process the following types of queries:
- Add a line
- Find the maximum point in any line at position
Input
The first line has an integer : the number of queries.
The following lines describe the queries. The format of each line is either "1 " or "2 ".
You may assume that the first query is of type 1.
Output
Print the answer for each query of type 2.
Constraints
Example
Input:
6 1 1 2 2 1 2 3 1 0 4 2 1 2 3
Output:
3 5 4 5