#include using namespace std; typedef long long ll; typedef long long unsigned llu; typedef double dl; typedef pair pii; typedef pair pll; typedef vector vi; typedef vector vl; typedef map mii; typedef map mll; typedef map msi; typedef map mci; typedef pair piii; typedef vector vpii; typedef vector vpiii; #define pi acos(-1.0) #define S second #define F first #define pb push_back #define mkp make_pair #define mem(a,b) memset(a,b,sizeof a) #define all(v) v.begin(),v.end() #define vsort(v) sort(v.begin(),v.end()) #define IO ios_base::sync_with_stdio(false);cin.tie(NULL) #define gcd(a,b) __gcd(a,b) #define FOR(i,a,b) for(int i=a;i<=b;i++) #define RFOR(i,a,b) for(int i=a;i>=b;i--) #define I(a) scanf("%d",&a) #define I2(a,b) scanf("%d%d",&a,&b) #define L(a) scanf("%lld",&a) #define L2(a,b) scanf("%lld%lld",&a,&b) #define D(a) scanf("%lf",&a) #define SP cout<<" "; #define PI(a) printf("%d",a) #define PL(a) printf("%lld",a) #define PD(a) printf("%lf",a) #define CHK cout<<"MK"< inline T BMOD(T p,T e,T m){T ret=1;while(e){if(e&1) ret=(ret*p)%m;p=(p*p)%m;e>>=1;}return (T)ret;} template inline T MODINV(T a,T m){return BMOD(a,m-2,m);} template inline T isPrime(T a){for(T i=2;i<=sqrt(double(a));i++){if(a%i==0){return 0;}}return 1;} template inline T lcm(T a, T b){return (a/gcd(a,b))*b;} template inline T power(T a, T b){return (b==0)?1:a*power(a,b-1);} template inline string toString(T t) { stringstream ss; ss< inline long long toLong(T t) {stringstream ss;ss<>ret;return ret;} template inline int toInt(T t) {stringstream ss;ss<>ret;return ret;} template inline bool leapYear(T t){if(!(t%(T)400) || (!(t%(T)4) && t%(T)100)) return true; return false;} //~ cout << fixed << setprecision(20) << Ans << endl; //~ priority_queue >pq; //for dijkstra /* _ */ /*____________|\/||_||\||_________________*/ string buffer; int INT(){ getline(cin,buffer); return toInt(buffer); } int LONG(){ getline(cin,buffer); return toLong(buffer); } const int MX = 100010; const ll MD = 1e9+7; ll Ans[MX][30],q,l,r,fact[MX];; vectoro,v; int main() { IO; //~ freopen("/home/krishna/PRG/practice/input.in","r",stdin); //~ cout<<"Ready to go!"<>s; for(int i=1;i<=(int)s.size();i++){ for(int j=0;j<26;j++) Ans[i][j]=Ans[i-1][j]; Ans[i][s[i-1]-'a']++; } fact[0]=1; for(int i = 1;i>q; while(q--){ o.clear(); v.clear(); //ans = 0; cin>>l>>r; int tl = 0; ll cnt = 0; for(int k = 0;k<26;k++){ ll t = Ans[r][k]-Ans[l-1][k]; //cout<