Given a sequence $A_1, A_2, \ldots, A_N$ of length $N$. Write a program to execute the following queries:
i j: output the number of occurrences of the most frequent number among $A_i, A_{i+1}, \ldots, A_j$.
Input
The first line contains the length $N$ of the sequence $(1 \le N \le 100{,}000)$.
The second line contains $A_1, A_2, \ldots, A_N$ $(1 \le A_i \le 100{,}000)$.
The third line contains the number $M$ of queries $(1 \le M \le 100{,}000)$.
The next $M$ lines each contain a query $i, j$ $(1 \le i \le j \le n)$.
Output
For each query, output one line containing the answer.
Examples
Sample Input 1
5 1 2 1 3 3 3 1 3 2 3 1 5
Sample Output 1
2 1 2