Monk and his friend Micro are on a quest to find the answer of Life, Universe and Everything. In order to complete it they need to answer Q queries on an array A having N integers. The queries can be of following two types:
0 x: Find the number of numbers in A which are not less than x.
1 x: Find the number of numbers in A which are greater than x.
Help them complete the quest and be back in time for the next Code Monk Challenge.
Input Format:
First line consists of a single integer denoting N.
Second line consists of N space separated integers denoting the array A.
Third line consists of a single integer denoting Q.
Each of the following Q lines consists of a query of one of the given two types.
Output Format:
For each query print the required answer in new line.
Constraints:
1≤N≤105
1≤Q≤3×105
1≤A[i],x≤109
For first query, there are no numbers in the array which are not less than 5 so answer for first query is 0.
For second query, 4 is the only number greater than 3, so answer is 1.
For third query, 3 and 4 are the numbers in array which are not less than 3, so answer is 2.