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.

/**
* @author: Prasad Chaudhari
* @linkedIn: https://www.linkedin.com/in/prasad-chaudhari-841655a6/
* @git: https://github.com/Prasad-Chaudhari
*/
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.Random;

public class Main {
    public static void main(String args[]) throws Exception {
        FastIO in = new FastIO(args);
        // int t = in.ni();
        int t = 1;
        while (t-- > 0) {
            int n = in.ni();
            int q = in.ni();
            char c[] = in.next().toCharArray();
            int a[][] = new int[n][26];
            for (int i = 0; i < n; i++) {
                if (i != 0) {
                    a[i] = Arrays.copyOf(a[i - 1], 26);
                }
                a[i][c[i] - 'a']++;
            }

            while (q-- > 0) {
                int l = in.ni() - 1;
                int r = in.ni() - 1;
                int count[] = Arrays.copyOf(a[r], 26);
                for (int i = 0; i < 26; i++)
                    if (l != 0)
                        count[i] -= a[l - 1][i];
                long ans = 0;
                for (int i = 0; i < 26; i++) {
                    // if (count[i] != 0)
                    //     System.out.println(i + " " + count[i]);
                    ans += (i + 1) * count[i];
                }
                System.out.println(ans);
            }
        }
        in.bw.flush();
    }

    // public static void main(String[] args) throws Exception {
    // FastIO in = new FastIO(args);
    // // int t = in.ni();
    // // while (t-- > 0) {
    // int n = in.ni();
    // ArrayList<LinkedList<Integer>> l = new ArrayList<>();
    // for (int i = 0; i <= n; i++)
    // l.add(new LinkedList<>());

    // int start = (new Random()).nextInt(n) + 1;
    // in.println("? " + start);
    // in.bw.flush();
    // ArrayList<LinkedList<Integer>> al = new ArrayList<>();

    // int levelOf[] = new int[n + 1];

    // Stack<Integer> st = new Stack<>();
    // for (int i = 0; i < n; i++) {
    // int d = in.ni();
    // while (d >= al.size()) {
    // al.add(new LinkedList<>());
    // }
    // al.get(d).add(i + 1);
    // if (d == 2)
    // st.push(i + 1);
    // else if (d == 1)
    // l.get(start).add(i + 1);
    // levelOf[i + 1] = d;
    // }

    // boolean[] visited = new boolean[n + 1];
    // visited[start] = true;

    // while (!st.isEmpty()) {
    // int root = st.pop();
    // if (visited[root])
    // continue;
    // visited[root] = true;
    // in.println("? " + root);
    // in.bw.flush();
    // int ds[] = in.gia(n);
    // int parent = -1;
    // for (int i = 0; i < n; i++)
    // if (ds[i] == 1 && levelOf[root] - 1 == levelOf[i + 1]) {
    // parent = i + 1;
    // break;
    // }
    // for (int i = 0; i < n; i++) {
    // if (ds[i] == 2) {
    // if (levelOf[i + 1] == levelOf[root]) {
    // l.get(parent).add(i + 1);
    // visited[i + 1] = true;
    // } else if (levelOf[root] + 2 == levelOf[i + 1]) {
    // st.push(i + 1);
    // }
    // } else if (ds[i] == 1) {
    // l.get(root).add(i + 1);
    // }
    // }
    // }
    // Map<Integer, Set<Integer>> map = new HashMap<>();
    // in.println("!");
    // for (int i = 1; i <= n; i++)
    // for (int j : l.get(i)) {
    // int u = i;
    // int v = j;
    // if (u > v) {
    // u ^= v;
    // v ^= u;
    // u ^= v;
    // }
    // if (!map.containsKey(u))
    // map.put(u, new HashSet<>());
    // map.get(u).add(v);
    // }
    // int count = 0;
    // for (int i : map.keySet()) {
    // count += map.get(i).size();
    // }
    // if (count != n - 1)
    // throw new RuntimeException();
    // for (int i : map.keySet()) {
    // for (int j : map.get(i))
    // in.println(i + " " + j);
    // }
    // in.bw.flush();
    // // }
    // in.bw.flush();
    // }

    static class Expo {

        static long a_pow_n_mod_m(long a, long n, long m) {
            long ans = 1;
            while (n > 0) {
                if ((n & 1) == 1)
                    ans = (ans * a) % m;
                a = (a * a) % m;
                n >>= 1;
            }
            return ans;
        }

        static long a_pow_n(long a, long n) {
            long ans = 1;
            while (n > 0) {
                if ((n & 1) == 1)
                    ans *= a;
                a *= a;
                n >>= 1;
            }
            return ans;
        }
    }

    static class Data implements Comparable<Data> {

        int a, b;

        public Data(int a, int b) {
            this.a = a;
            this.b = b;
        }

        @Override
        public int compareTo(Data o) {
            if (a == o.a) {
                return Integer.compare(b, o.b);
            }
            return Integer.compare(a, o.a);
        }

        public static void sort(int a[]) {
            Data d[] = new Data[a.length];
            for (int i = 0; i < a.length; i++) {
                d[i] = new Data(a[i], 0);
            }
            Arrays.sort(d);
            for (int i = 0; i < a.length; i++) {
                a[i] = d[i].a;
            }
        }
    }

    static class FastIO {

        private final BufferedReader br;
        private final BufferedWriter bw;
        private String s[];
        private int index;

        public FastIO(String[] args) throws IOException {
            if (args.length > 1) {
                br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(args[0]))));
                bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(args[1]))));
            } else {
                br = new BufferedReader(new InputStreamReader(System.in));
                bw = new BufferedWriter(new OutputStreamWriter(System.out, "UTF-8"));
            }
            s = br.readLine().split(" ");
            index = 0;
        }

        public int ni() throws IOException {
            return Integer.parseInt(nextToken());
        }

        public double nd() throws IOException {
            return Double.parseDouble(nextToken());
        }

        public long nl() throws IOException {
            return Long.parseLong(nextToken());
        }

        public String next() throws IOException {
            return nextToken();
        }

        public String nli() throws IOException {
            try {
                return br.readLine();
            } catch (IOException ex) {

            }
            return null;
        }

        public int[] gia(int n) throws IOException {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = ni();
            }
            return a;
        }

        public int[] gia(int n, int start, int end) throws IOException {
            validate(n, start, end);
            int a[] = new int[n];
            for (int i = start; i < end; i++) {
                a[i] = ni();
            }
            return a;
        }

        public double[] gda(int n) throws IOException {
            double a[] = new double[n];
            for (int i = 0; i < n; i++) {
                a[i] = nd();
            }
            return a;
        }

        public double[] gda(int n, int start, int end) throws IOException {
            validate(n, start, end);
            double a[] = new double[n];
            for (int i = start; i < end; i++) {
                a[i] = nd();
            }
            return a;
        }

        public long[] gla(int n) throws IOException {
            long a[] = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = nl();
            }
            return a;
        }

        public long[] gla(int n, int start, int end) throws IOException {
            validate(n, start, end);
            long a[] = new long[n];
            for (int i = start; i < end; i++) {
                a[i] = nl();
            }
            return a;
        }

        public void print(String s) throws IOException {
            bw.write(s);
        }

        public void println(String s) throws IOException {
            bw.write(s);
            bw.newLine();
        }

        public void print(int s) throws IOException {
            bw.write(s + "");
        }

        public void println(int s) throws IOException {
            bw.write(s + "");
            bw.newLine();
        }

        public void print(long s) throws IOException {
            bw.write(s + "");
        }

        public void println(long s) throws IOException {
            bw.write(s + "");
            bw.newLine();
        }

        public void print(double s) throws IOException {
            bw.write(s + "");
        }

        public void println(double s) throws IOException {
            bw.write(s + "");
            bw.newLine();
        }

        private String nextToken() throws IndexOutOfBoundsException, IOException {
            if (index == s.length) {
                s = br.readLine().split(" ");
                index = 0;
            }
            return s[index++];
        }

        private void validate(int n, int start, int end) {
            if (start < 0 || end >= n) {
                throw new IllegalArgumentException();
            }
        }
    }
}
