#include using namespace std; void initialize(string s) { // This function is called once before all queries. } int answerQuery(int l, int r, string s) { // Return the answer for this query modulo 1000000007. int m=1000000007; l--; r--; int a[26]={0},i; for(i=l;i<=r;i++) { a[(int)s[i]-97]++; } // for(i=0;i<26;i++) // cout<> s; //initialize(s); int q; cin >> q; for(int a0 = 0; a0 < q; a0++){ int l; int r; cin >> l >> r; int result = answerQuery(l, r,s); cout << result << endl; } return 0; }