#pragma clang diagnostic push
#pragma ide diagnostic ignored "hicpp-signed-bitwise"
//#define TESTS
//#define FILE_IO
#define FILE_IN "input.in"
#define FILE_OUT "bees.out"
#define FAST_IO

#ifndef DEBUG
#define gcd(x, y) __gcd(x, y)
#endif


#include <iostream>
#include <vector>
#include <iomanip>
#include <queue>
#include <cmath>
#include <cassert>
#include <climits>
#include <numeric>
#include <functional>
#include <stack>
#include <algorithm>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <random>
#include <bitset>
#include <chrono>
#include <sstream>
#include <fstream>
#include <cstring>
#include <complex>

using namespace std;
#define endl '\n'
#define MP make_pair
#define pb push_back
#define ll long long
#define ld long double
#define cld complex<ld>
#define vcld vector<complex<ld>>
#define ull unsigned ll
#define pll pair<ll, ll>
#define vl vector<ll>
#define vb vector<bool>
#define vvl vector<vl>
#define vi vector<int>
#define vvi vector<vi>
#define vb vector<bool>
#define vvb vector<vb>
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define kill(x) {ps(x); return;}
#define sz(x) (int)x.size()
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) FOR(i,0,a)
#define ROF(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define R0F(i, a) ROF(i,0,a)
#define rep(n) F0R(_, n)
#define trav(a, x) for (auto& a : x)
#define bits(x) __builtin_popcount(x)
#define bit(x, i) ((((x) >> (i)) & 1) != 0)
#ifdef DEBUG
#define dbg(x...) pr("[",#x,"] = ["), pc(x)
#else
#define dbg(x...) 0x12c
#endif

//mt19937 rng(45123);
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const long long INF = 1e17;
const int INF32 = 1e9;

//@formatter:off
template<class T>
bool chkmin(T &a, const T &b) { return a > b ? a = b, 1 : 0; }

template<class T>
bool chkmaax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }

inline ll mul(ll a, ll b) {
    return (INF / a > b ? a * b : INF);
}

inline ll add(ll a, ll b) {
    return (a + b >= INF ? INF : a + b);
}

namespace input {
    template<class T>
    void re(complex<T> &x);

    template<class T1, class T2>
    void re(pair<T1, T2> &p);

    template<class T>
    void re(vector<T> &a);

    template<class T, size_t SZ>
    void re(array<T, SZ> &a);

    template<class T>
    void re(T &x) { cin >> x; }

    void re(double &x) {
        string t;
        re(t);
        x = stod(t);
    }

    void re(ld &x) {
        string t;
        re(t);
        x = stold(t);
    }

    template<class T, class... Ts>
    void re(T &t, Ts &... ts) {
        re(t);
        re(ts...);
    }

    template<class T>
    void re(complex<T> &x) {
        T a, b;
        re(a, b);
        x = cd(a, b);
    }

    template<class T1, class T2>
    void re(pair<T1, T2> &p) { re(p.first, p.second); }

    template<class T>
    void re(vector<T> &a) { F0R(i, sz(a)) re(a[i]); }

    template<class T, size_t SZ>
    void re(array<T, SZ> &a) { F0R(i, SZ) re(a[i]); }
}

using namespace input;

namespace output {
    void pr(int x) { cout << x; }

    void pr(long x) { cout << x; }

    void pr(ll x) { cout << x; }

    void pr(unsigned x) { cout << x; }

    void pr(unsigned long x) { cout << x; }

    void pr(unsigned long long x) { cout << x; }

    void pr(float x) { cout << x; }

    void pr(double x) { cout << x; }

    void pr(ld x) { cout << x; }

    void pr(char x) { cout << x; }

    void pr(const char *x) { cout << x; }

    void pr(const string &x) { cout << x; }

    void pr(bool x) { pr(x ? "1" : "0"); }

    template<class T>
    void pr(const complex<T> &x) { cout << x; }

    template<class T1, class T2>
    void pr(const pair<T1, T2> &x);

    template<class T>
    void pr(const T &x);

    template<class T, class... Ts>
    void pr(const T &t, const Ts &... ts) {
        pr(t);
        pr(ts...);
    }

    template<class T1, class T2>
    void pr(const pair<T1, T2> &x) {
        pr("{", x.first, " , ", x.second, "}");
    }

    template<class T>
    void pr(const T &x) {
        pr("{"); // const iterator needed for vector<bool>
        bool fst = 1;
        for (const auto &a: x) pr(!fst ? ", " : "", a), fst = 0;
        pr("}");
    }

    void ps() { pr("\r\n"); } // print w/ spaces
    template<class T, class... Ts>
    void ps(const T &t, const Ts &... ts) {
        pr(t);
        if (sizeof...(ts)) pr(" ");
        ps(ts...);
    }

    void pc() { pr("]\r\n"); } // debug w/ commas
    template<class T, class... Ts>
    void pc(const T &t, const Ts &... ts) {
        pr(t);
        if (sizeof...(ts)) pr(", ");
        pc(ts...);
    }
}
using namespace output;
// @formatter:on

void solve();

void precalc();

int main() {
#ifdef FAST_IO
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin.sync_with_stdio(0);
    cout.tie(0);
#endif
#ifdef DEBUG
    auto start = chrono::steady_clock::now();
    freopen(FILE_IN, "r", stdin);
#endif
#ifndef DEBUG
#ifdef FILE_IO
    freopen(FILE_IN, "r", stdin);
    freopen(FILE_OUT, "w", stdout);
#endif
#endif
    precalc();
#ifdef TESTS
    int t;
    cin >> t;
    while (t--)
        solve();
#else

    solve();


#endif
#ifdef DEBUG
    auto end = chrono::steady_clock::now();
    cout << endl << "_______________\nElapsed: "
         << chrono::duration_cast<chrono::milliseconds>(end - start).count()
         << " ms" << endl;
#endif
    return 0;
}

vl pri;

void precalc() {
//    ll N = 2000;
//    vl lp(N+1);
//    for (ll i=2; i<=N; ++i) {
//        if (lp[i] == 0) {
//            lp[i] = i;
//            pri.push_back (i);
//        }
//        for (ll j=0; j<(ll)pri.size() && pri[j]<=lp[i] && i*pri[j]<=N; ++j)
//            lp[i * pri[j]] = pri[j];
//    }//resheto
}

//////////////////////// -- CODE IS HERE -- ////////////////////////
ll mod = 1e9 + 7;

int binpow(ll a, ll n) {
    ll res = 1;
    while (n) {
        if (n & 1)
            res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res % mod;
}

void solve() {
    ll t, a, b, c, n,l;
    string s;
    cin>>l>>t;
    cin>>s;
    vl p(l+1);
    p[0]=0;
    for(ll i=0;i<l;i++){
        p[i+1]=p[i]+(s[i]-'a'+1);
    }
    dbg(p);
    while(t--){
        cin>>a>>b;
        cout<<p[b]-p[a-1]<<endl;
    }
}


#pragma clang diagnostic pop
### Prompt

Please formulate a CPP solution to the following 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.

### Response

```cpp
#pragma clang diagnostic push
#pragma ide diagnostic ignored "hicpp-signed-bitwise"
//#define TESTS
//#define FILE_IO
#define FILE_IN "input.in"
#define FILE_OUT "bees.out"
#define FAST_IO

#ifndef DEBUG
#define gcd(x, y) __gcd(x, y)
#endif


#include <iostream>
#include <vector>
#include <iomanip>
#include <queue>
#include <cmath>
#include <cassert>
#include <climits>
#include <numeric>
#include <functional>
#include <stack>
#include <algorithm>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <random>
#include <bitset>
#include <chrono>
#include <sstream>
#include <fstream>
#include <cstring>
#include <complex>

using namespace std;
#define endl '\n'
#define MP make_pair
#define pb push_back
#define ll long long
#define ld long double
#define cld complex<ld>
#define vcld vector<complex<ld>>
#define ull unsigned ll
#define pll pair<ll, ll>
#define vl vector<ll>
#define vb vector<bool>
#define vvl vector<vl>
#define vi vector<int>
#define vvi vector<vi>
#define vb vector<bool>
#define vvb vector<vb>
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define kill(x) {ps(x); return;}
#define sz(x) (int)x.size()
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) FOR(i,0,a)
#define ROF(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define R0F(i, a) ROF(i,0,a)
#define rep(n) F0R(_, n)
#define trav(a, x) for (auto& a : x)
#define bits(x) __builtin_popcount(x)
#define bit(x, i) ((((x) >> (i)) & 1) != 0)
#ifdef DEBUG
#define dbg(x...) pr("[",#x,"] = ["), pc(x)
#else
#define dbg(x...) 0x12c
#endif

//mt19937 rng(45123);
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const long long INF = 1e17;
const int INF32 = 1e9;

//@formatter:off
template<class T>
bool chkmin(T &a, const T &b) { return a > b ? a = b, 1 : 0; }

template<class T>
bool chkmaax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }

inline ll mul(ll a, ll b) {
    return (INF / a > b ? a * b : INF);
}

inline ll add(ll a, ll b) {
    return (a + b >= INF ? INF : a + b);
}

namespace input {
    template<class T>
    void re(complex<T> &x);

    template<class T1, class T2>
    void re(pair<T1, T2> &p);

    template<class T>
    void re(vector<T> &a);

    template<class T, size_t SZ>
    void re(array<T, SZ> &a);

    template<class T>
    void re(T &x) { cin >> x; }

    void re(double &x) {
        string t;
        re(t);
        x = stod(t);
    }

    void re(ld &x) {
        string t;
        re(t);
        x = stold(t);
    }

    template<class T, class... Ts>
    void re(T &t, Ts &... ts) {
        re(t);
        re(ts...);
    }

    template<class T>
    void re(complex<T> &x) {
        T a, b;
        re(a, b);
        x = cd(a, b);
    }

    template<class T1, class T2>
    void re(pair<T1, T2> &p) { re(p.first, p.second); }

    template<class T>
    void re(vector<T> &a) { F0R(i, sz(a)) re(a[i]); }

    template<class T, size_t SZ>
    void re(array<T, SZ> &a) { F0R(i, SZ) re(a[i]); }
}

using namespace input;

namespace output {
    void pr(int x) { cout << x; }

    void pr(long x) { cout << x; }

    void pr(ll x) { cout << x; }

    void pr(unsigned x) { cout << x; }

    void pr(unsigned long x) { cout << x; }

    void pr(unsigned long long x) { cout << x; }

    void pr(float x) { cout << x; }

    void pr(double x) { cout << x; }

    void pr(ld x) { cout << x; }

    void pr(char x) { cout << x; }

    void pr(const char *x) { cout << x; }

    void pr(const string &x) { cout << x; }

    void pr(bool x) { pr(x ? "1" : "0"); }

    template<class T>
    void pr(const complex<T> &x) { cout << x; }

    template<class T1, class T2>
    void pr(const pair<T1, T2> &x);

    template<class T>
    void pr(const T &x);

    template<class T, class... Ts>
    void pr(const T &t, const Ts &... ts) {
        pr(t);
        pr(ts...);
    }

    template<class T1, class T2>
    void pr(const pair<T1, T2> &x) {
        pr("{", x.first, " , ", x.second, "}");
    }

    template<class T>
    void pr(const T &x) {
        pr("{"); // const iterator needed for vector<bool>
        bool fst = 1;
        for (const auto &a: x) pr(!fst ? ", " : "", a), fst = 0;
        pr("}");
    }

    void ps() { pr("\r\n"); } // print w/ spaces
    template<class T, class... Ts>
    void ps(const T &t, const Ts &... ts) {
        pr(t);
        if (sizeof...(ts)) pr(" ");
        ps(ts...);
    }

    void pc() { pr("]\r\n"); } // debug w/ commas
    template<class T, class... Ts>
    void pc(const T &t, const Ts &... ts) {
        pr(t);
        if (sizeof...(ts)) pr(", ");
        pc(ts...);
    }
}
using namespace output;
// @formatter:on

void solve();

void precalc();

int main() {
#ifdef FAST_IO
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin.sync_with_stdio(0);
    cout.tie(0);
#endif
#ifdef DEBUG
    auto start = chrono::steady_clock::now();
    freopen(FILE_IN, "r", stdin);
#endif
#ifndef DEBUG
#ifdef FILE_IO
    freopen(FILE_IN, "r", stdin);
    freopen(FILE_OUT, "w", stdout);
#endif
#endif
    precalc();
#ifdef TESTS
    int t;
    cin >> t;
    while (t--)
        solve();
#else

    solve();


#endif
#ifdef DEBUG
    auto end = chrono::steady_clock::now();
    cout << endl << "_______________\nElapsed: "
         << chrono::duration_cast<chrono::milliseconds>(end - start).count()
         << " ms" << endl;
#endif
    return 0;
}

vl pri;

void precalc() {
//    ll N = 2000;
//    vl lp(N+1);
//    for (ll i=2; i<=N; ++i) {
//        if (lp[i] == 0) {
//            lp[i] = i;
//            pri.push_back (i);
//        }
//        for (ll j=0; j<(ll)pri.size() && pri[j]<=lp[i] && i*pri[j]<=N; ++j)
//            lp[i * pri[j]] = pri[j];
//    }//resheto
}

//////////////////////// -- CODE IS HERE -- ////////////////////////
ll mod = 1e9 + 7;

int binpow(ll a, ll n) {
    ll res = 1;
    while (n) {
        if (n & 1)
            res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res % mod;
}

void solve() {
    ll t, a, b, c, n,l;
    string s;
    cin>>l>>t;
    cin>>s;
    vl p(l+1);
    p[0]=0;
    for(ll i=0;i<l;i++){
        p[i+1]=p[i]+(s[i]-'a'+1);
    }
    dbg(p);
    while(t--){
        cin>>a>>b;
        cout<<p[b]-p[a-1]<<endl;
    }
}


#pragma clang diagnostic pop
```