You are given a string s of length n.You are also given q queries of the form L R . For each query you have to find out the number of distinct strings that can be formed using the characters sL,sL+1,.......,sR .
Since the answer can be very large print the answer modulo 109 +7.
NOTE : All permutations of a string are considered same. For example : {"abc","acb","bac","bca","cab",cba"} all are considered same.
INPUT FORMAT
First line contains the length of the string n.
Second line contains the string s.
Third line contains the number of queries q.
Next q lines denote the queries ,each query containing two space separarted integers L and R.
OUTPUT FORMAT
For each query print the answer in a separate line.
CONSTRAINTS
1≤n≤105
1≤q≤105
1≤L,R≤n
String contains only lowercase english alphabets.
For the first query possible strings are a,b,c,aa,ab,ac,bc,abc,aab,aac,aabc.
For the second query possible strings are b,c,bc.