Problem: Petya once wrote a sad love song and shared it to Vasya. The song is a string consisting of lowercase English letters. Vasya made up q questions about this song. Each question is about a subsegment of the song starting from the l-th letter to the r-th letter. Vasya considers a substring made up from characters on this segment and repeats each letter in the subsegment k times, where k is the index of the corresponding letter in the alphabet. For example, if the question is about the substring "abbcb", then Vasya repeats letter 'a' once, each of the letters 'b' twice, letter 'c" three times, so that the resulting string is "abbbbcccbb", its length is 10. Vasya is interested about the length of the resulting string.

Help Petya find the length of each string obtained by Vasya.

Input

The first line contains two integers n and q (1≤ n≤ 100 000, 1≤ q ≤ 100 000) — the length of the song and the number of questions. 

The second line contains one string s — the song, consisting of n lowercase letters of English letters.

Vasya's questions are contained in the next q lines. Each line contains two integers l and r (1 ≤ l ≤ r ≤ n) — the bounds of the question.

Output

Print q lines: for each question print the length of the string obtained by Vasya.

Examples

Input


7 3
abacaba
1 3
2 5
1 7


Output


4
7
11


Input


7 4
abbabaa
1 3
5 7
6 6
2 4


Output


5
4
1
5


Input


13 7
sonoshikumiwo
1 5
2 10
7 7
1 13
4 8
2 5
3 9


Output


82
125
9
191
62
63
97

Note

In the first example Vasya is interested in three questions. In the first question Vasya considers the substring "aba", that transforms to "abba", so the answer is equal to 4. In the second question Vasya considers "baca", that transforms to "bbaccca", so the answer is 7. In the third question Vasya considers the string "abacaba",that transforms to "abbacccabba" of length 11.

Solution (in CPP):

Solution:
#include<bits/stdc++.h>
using namespace std;

// GCC Optimizations
#pragma GCC optimize("Ofast")
#pragma GCC target("fma,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("unroll-loops")

//MACROS
#define ll long long
//to be excluded in critical cases(thanks to @Amank2854) https://codeforces.com/contest/1538/submission/119014768
#define int ll
#define endl "\n"
#define pb push_back
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define umap unordered_map
#define all(v) v.begin() , v.end()   
#define min3(a1,b1,cost) min(a1,min(b1,cost))
#define min4(a1,b1,cost,d ) min(a1 , min(b1 , min(cost,d)))
#define max3(a1,b1,cost) max(a1 , max(b1,cost))
#define max4(a1,b1,cost,d) max(max(a1,b1) , max(cost,d))
#define vecti vector<int> 
#define ld long double    
#define debug(a) cout<<a<<endl;
#define debugtwo(a1,b1) cout<<a1<<" "<<b1<<endl;                          
#define pq priority_queue
#define pii pair<int,int>
#define frq(NN)  for(int UUU=0;UUU<(NN);UUU++)  
#define minvec *min_element
#define maxvec *max_element
#define fori(II,GG,HH) for(int II=(GG);II<(HH);II++)
#define yes cout<<"Yes"<<endl;
#define no cout<<"No"<<endl;
#define YES cout<<"YES"<<endl;
#define NO cout<<"NO"<<endl;
#define rep(RRR,FFF)  for(auto &RRR:FFF)
#define sz(AA)  (int)((AA).size())
#define minus cout<<"-1\n";
#define zero cout<<"0\n";
#define print(x) cout<<(x)<<endl;
#define read(FDFDFDF)  for(auto &FFFF:FDFDFDF){cin>>FFFF;}
// Array utils
#define ub upper_bound
#define lb lower_bound 
#define bs binary_search
int comb(int n, int r)
{if(r<0||r>n)return 0;if((n-r)<r)r=n-r; // nCr
int a=1;for(int i=n;i>n-r;--i){a=a*i;}for(int i=1;i<r+1;++i){a=a/i;}return a;}

// Bitwise operations
int Set(int qq , int pos){return (qq|(1<<pos));}
int chk(int qq , int pos){return (qq&(1<<pos));}
int p2(int idx){return ((1LL<<idx));};

// Maths//Modular exponential
int modpow(int x, int n, int m) 
{
   if (n == 0) return 1%m;
   int u = modpow(x,n/2,m);
   u = (u*u)%m;
   if (n%2 == 1) u = (u*x)%m;
   return u;
}

int gcd(int a,int b)                  //gcd function
{
    if(b==0)
    return a;
    else return gcd(b,a%b);
}

int _pow(int a, int b)
{
   if(!b)return 1;
   ll temp = _pow(a, b/2);
   temp = (temp * temp);
   if(b%2)return (a * temp);
   return temp;
}
int ceil(int a, int b){if(a%b)return 1 + a/b;return a/b;}

void printvec(const vecti &AAA)
{
   for(auto SDDD:AAA)cout<<SDDD<<" ";
   cout<<endl;
}
int dx[] = {0 , 0 , -1 , 1};
int dy[] = {1 , -1 , 0 , 0};

const int MOD = 1e9 + 7;
const int N = 1e5+10;
const int inf = 1e18;


void solve()
{
   int n,q;cin>>n>>q;
   string s;cin>>s;


   vector<vecti> dp(n,vecti (26,0));


   
    dp[0][s[0]-'a']++;
    

    for(int i=0;i<n;i++)
    {
        // printvec(dp[i]);
    }
   for(int i=1;i<n;i++)
   {
       int c=s[i]-'a';
    //    cout<<c<<endl;
       for(int j=0;j<26;j++)
       {
           if(j==c)dp[i][j]=dp[i-1][j]+1;
           else 
           dp[i][j]=dp[i-1][j];
       }
   }

   frq(q)
   {
       int u,v;cin>>u>>v;
       u--;
       v--;
       if(u==0)
       {
           int sum=0;
           for(int i=0;i<26;i++)
           {
               sum+=(i+1)*(dp[v][i]);
           }

           cout<<sum<<endl;
       }
       else 
       {
           int sum=0;

           for(int i=0;i<26;i++)
           {
               sum+=(i+1)*(dp[v][i]-dp[u-1][i]);
           }
           cout<<sum<<endl;
       }

   }
}

signed main() 
{
   IOS
   int TESTS=1;
//    cin>>TESTS;
   int GOOOGLE=1;
   while(TESTS--)
   {
      // cout<<"Case #"<<GOOOGLE<<": ";
      solve();
      // cout<<flush;
      GOOOGLE++;
   }
}