Mr. Gora is extremely disappointed with the performance of the students in his subject.
He felt that something was AMISS. Therefore, he decided to conduct another NIGHT SHOW (lab exam :P ) for his students to test their basic understanding of the subject.
The question was extremely "simple".
The students are initially provided an array with no elements at all. (the indexing of the array is 1-based).
The students are provided with some queries as follows -
Students have to solve this question anyhow to pass the exam.
You being an excellent coder have to help these students.
The first line of the input contains an integer Q denoting the number of the queries. Q lines follow. The queries are of the following form.
For each query of type 2, 3 and 4, you need to output answer on a separate line.
Let M be the number of elements in the array before any particular query.
Problem Setter - Shivam Garg
10 queries are provided.
Query 1 The first unallocated index is 1. So 4 is placed there.
Query 2 The first unallocated index is 2. So 5 is placed there.
Query 3 The first unallocated index is 3. So 7 is placed there.
Query 4 The first unallocated index is 4. So 4 is placed there.
Query 5 In the range 1 to 3, we have no integer less than 4. So, the output is 0.
Query 6 In the range 2 to 4, we have 1 integer equal to 5. So, the output is 1.
Query 7 The first unallocated index is 5. So 6 is placed there.
Query 8 In the range 1 to 5, we have 3 integers greater than 4. So, the output is 3.
Query 9 In the range 4 to 5, we have 1 integer less than 5. So, the output is 1.
Query 10 In the range 2 to 4, we have 2 integer less than 7. So, the output is 2.