You are given a permutation with length $$n$$. You want to play a game with you friend, Bob, and the rule will be as follows:
You are given a permutation $$a$$ contains all numbers $$1$$ to $$n$$. And, in $$q$$ queries, each query has two integers $$l$$ and $$r$$.
For each query, you have to help Bob find the maximum value that does not exist in the subarray $$[l,r]$$.
Note: A permutation is a sequence of integers from $$1$$ to $$n$$ of length $$n$$ containing each number exactly once.
For example, (1), (4, 3, 5, 1, 2), (3, 2, 1) are permutations and (1, 1), (4, 3, 1), (2, 3, 4) are not.
Input format
Output format
Print the maximum number that does not exist in the subarray $$[l, r]$$.
Constraints
$$2 \le n,q \le 10^5$$
$$1 \le a_i \le n$$
$$1 \le l,r \le n$$
$$1 \le l-r+1 < n$$
In the sample, we have a permutation (2, 3, 1, 5, 4)
the first test-case [l,r] = [1,2] so we have to find the maximum number of the array except for the subarray [1,2]
in other words, we have to find the maximum number for the subarray [3,5] which will be 5.