An array of integers is given. You need to answer queries. For each query, determine how many numbers in the segment [l, r] have values less than .
The first line contains one integer n~(1 \le n \le 2 \cdot 10^5) — the length of the array.
The second line contains integers — the elements of the array.
The third line contains one integer q~(1 \le q \le 10^5) — the number of queries.
Each of the following lines describes a query and contains three integers , , and x~(l \le r, 1 \le x \le 10^9).
For each query, print in a separate line the number of elements in the segment [l, r] that are less than .
1-nji mysal