A permutation of the first positive integers is given as an array. For each query, determine the smallest index of the array that contains a number from the segment inclusive.
The first line contains two integers and q~(1 \le n, q \le 10^5) — the size of the permutation and the number of queries, respectively.
The second line contains a permutation of distinct integers from to .
Each of the next lines contains two integers and v~(1 \le u \le v \le 10^5), defining the boundaries of the segment.
For each query, print the smallest index of the array that contains a number from the segment . Print the answers one per line.
Example 1