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.
import java.io.*;
import java.util.*;
import java.lang.*;

public class codeforces {
   public static void main(String[] args) {
      InputStream inputStream = System.in;
      OutputStream outputStream = System.out;
      if (System.getProperty("ONLINE_JUDGE") == null) {
         try {
            sc = new InputReader(new FileInputStream("input.txt"));
            out = new PrintWriter(new FileOutputStream("output.txt"));
            pr = new PrintWriter(new FileOutputStream("error.txt"));
         } catch (Exception ignored) {
         }
         int t = 1;
         // t = sc.nextInt();
         while (t-- > 0)
            solve();
         out.flush();
         pr.flush();

      } else {
         sc = new InputReader(inputStream);
         out = new PrintWriter(outputStream);
         pr = new PrintWriter(outputStream);
         int t = 1;
         // t = sc.nextInt();
         while (t-- > 0) {
            solve();
         }
         out.flush();
      }

   }

   public static void solve() {
      
      long sum = 0;
      int n = sc.nextInt();
      int q = sc.nextInt();
      long[] pre = new long[(int)1e5+1];
      String str = sc.next();
      pre[0]=0;
      for (int i = 1; i <= n; ++i) {
         sum += (int)str.charAt(i-1)-'a'+1;
         pre[i] = sum;
      }
      debug(pre);
      while (q-- > 0) {
         int a = sc.nextInt();
         int b = sc.nextInt();
         out.println(pre[b]-pre[a-1]);
      }
   }

   // Map Iterator:
   // for (Map.Entry<Integer, Integer> entry : map.entrySet()){}
   // System.out.println("Key => " + entry.getKey() + ", Value => " +
   // entry.getValue());}

   // Globals

   public static int inf = Integer.MAX_VALUE;
   public static int minf = Integer.MIN_VALUE;
   public static int mod = 1000000007;
   public static InputReader sc;
   public static PrintWriter out;
   public static PrintWriter pr;

   // FastReader Class

   static class InputReader {
      public BufferedReader reader;
      public StringTokenizer tokenizer;

      public InputReader(InputStream stream) {
         reader = new BufferedReader(new InputStreamReader(stream), 32768);
         tokenizer = null;
      }

      public String next() {
         while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
               tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
               throw new RuntimeException(e);
            }
         }
         return tokenizer.nextToken();
      }

      public int nextInt() {
         return Integer.parseInt(next());
      }

      public long nextLong() {
         return Long.parseLong(next());
      }

      public double nextDouble() {
         return Double.parseDouble(next());
      }
   }

   // Req Functions

   public static int countDigits(int l) {
      if (l >= 1000000000)
         return 10;
      if (l >= 100000000)
         return 9;
      if (l >= 10000000)
         return 8;
      if (l >= 1000000)
         return 7;
      if (l >= 100000)
         return 6;
      if (l >= 10000)
         return 5;
      if (l >= 1000)
         return 4;
      if (l >= 100)
         return 3;
      if (l >= 10)
         return 2;
      return 1;
   }

   public static int countDigits(long l) {
      if (l >= 1000000000000000000L)
         return 19;
      if (l >= 100000000000000000L)
         return 18;
      if (l >= 10000000000000000L)
         return 17;
      if (l >= 1000000000000000L)
         return 16;
      if (l >= 100000000000000L)
         return 15;
      if (l >= 10000000000000L)
         return 14;
      if (l >= 1000000000000L)
         return 13;
      if (l >= 100000000000L)
         return 12;
      if (l >= 10000000000L)
         return 11;
      if (l >= 1000000000L)
         return 10;
      if (l >= 100000000L)
         return 9;
      if (l >= 10000000L)
         return 8;
      if (l >= 1000000L)
         return 7;
      if (l >= 100000L)
         return 6;
      if (l >= 10000L)
         return 5;
      if (l >= 1000L)
         return 4;
      if (l >= 100L)
         return 3;
      if (l >= 10L)
         return 2;
      return 1;
   }

   public static long nCr(int n, int k) {
      long ans = 1L;
      k = k > n - k ? n - k : k;
      int j = 1;
      for (; j <= k; j++, n--) {
         if (n % j == 0) {
            ans *= n / j;
         } else if (ans % j == 0) {
            ans = ans / j * n;
         } else {
            ans = (ans * n) / j;
         }
      }
      return ans;
   }

   public static String reverseString(String input) {
      StringBuilder str = new StringBuilder("");

      for (int i = input.length() - 1; i >= 0; i--) {
         str.append(input.charAt(i));
      }
      return str.toString();
   }

   public static int maxOf3(int x, int y, int z) {
      return Math.max(x, Math.max(y, z));
   }

   public static int minof3(int x, int y, int z) {
      return Math.min(x, Math.min(y, z));
   }

   public static long maxOf3(long x, long y, long z) {
      return Math.max(x, Math.max(y, z));
   }

   public static long minof3(long x, long y, long z) {
      return Math.min(x, Math.min(y, z));
   }

   public static void arrInput(int[] arr, int n) {
      for (int i = 0; i < n; i++)
         arr[i] = sc.nextInt();
   }

   public static void arrInput(long[] arr, int n) {
      for (int i = 0; i < n; i++)
         arr[i] = sc.nextLong();
   }

   public static int maxarrInput(int[] arr, int n) {
      int max = 0;
      for (int i = 0; i < n; i++) {
         arr[i] = sc.nextInt();
         max = Math.max(max, arr[i]);
      }
      return max;

   }

   public static long maxarrInput(long[] arr, int n) {
      long max = 0;
      for (int i = 0; i < n; i++) {
         arr[i] = sc.nextLong();
         max = Math.max(max, arr[i]);
      }
      return max;
   }

   public static int minarrInput(int[] arr, int n) {
      int min = Integer.MAX_VALUE;
      for (int i = 0; i < n; i++) {
         arr[i] = sc.nextInt();
         min = Math.max(min, arr[i]);
      }
      return min;
   }

   public static long minarrInput(long[] arr, int n) {
      long min = 0;
      for (int i = 0; i < n; i++) {
         arr[i] = sc.nextLong();
         min = Math.max(min, arr[i]);
      }
      return min;
   }

   public static long sumofarr(int[] arr) {
      long sum = 0;
      for (int i : arr)
         sum += i;
      return sum;
   }

   public static long sumofarr(long[] arr) {
      long sum = 0;
      for (long i : arr)
         sum += i;
      return sum;
   }

   public static int lowerBound(int[] arr, int x) {
      int l = -1, r = arr.length;
      while (l + 1 < r) {
         int m = (l + r) >>> 1;
         if (arr[m] >= x)
            r = m;
         else
            l = m;
      }
      return r;
   }

   public static int upperBound(int[] arr, int x) {
      int l = -1, r = arr.length;
      while (l + 1 < r) {
         int m = (l + r) >>> 1;
         if (arr[m] <= x)
            l = m;
         else
            r = m;
      }
      return l + 1;
   }

   public static long maxofarr(long[] arr) {
      long max = 0;
      for (long i : arr)
         max = Math.max(i, max);
      return max;
   }

   public static long minofarr(long[] arr) {
      long min = Integer.MAX_VALUE;
      for (long i : arr)
         min = Math.min(min, i);
      return min;
   }

   public static int maxofarr(int[] arr) {
      int max = 0;
      for (int i : arr)
         max = Math.max(i, max);
      return max;
   }

   public static int minofarr(int[] arr) {
      int min = Integer.MAX_VALUE;
      for (int i : arr)
         min = Math.min(min, i);
      return min;
   }

   // debug

   public static boolean sysFlag = System.getProperty("ONLINE_JUDGE") == null;

   public static void debug(int x) {
      if (sysFlag)
         pr.println("Int-Ele: " + x);
   }

   public static void debug(String x) {
      if (sysFlag)
         pr.println("String: " + x);
   }

   public static void debug(long x) {
      if (sysFlag)
         pr.println("Long-Ele: " + x);
   }

   public static void debug(int[] arr) {
      if (sysFlag) {
         for (int i = 0; i < arr.length; ++i) {
            pr.println(i + " -> " + arr[i]);
         }
      }
   }

   public static void debug(long[] arr) {
      if (sysFlag) {
         for (int i = 0; i < arr.length; ++i) {
            pr.println(i + " -> " + arr[i]);
         }
      }
   }

   public static void debug(ArrayList<Integer> list) {
      if (sysFlag) {
         for (int i = 0; i < list.size(); ++i) {
            pr.println(i + " -> " + list.get(i));
         }
      }
   }

   public static void Ldebug(ArrayList<Long> list) {
      if (sysFlag) {
         for (int i = 0; i < list.size(); ++i) {
            pr.println(i + " -> " + list.get(i));
         }
      }
   }

   public static void debugmapII(HashMap<Integer, Integer> map) {
      if (sysFlag) {
         for (Map.Entry<Integer, Integer> entry : map.entrySet())
            pr.println("Key => " + entry.getKey() + ", Value => " + entry.getValue());
      }
   }

   public static void debugmapLI(HashMap<Long, Integer> map) {
      if (sysFlag) {
         for (Map.Entry<Long, Integer> entry : map.entrySet())
            pr.println("Key => " + entry.getKey() + ", Value => " + entry.getValue());
      }
   }

   public static void debugmapLL(HashMap<Long, Long> map) {
      if (sysFlag) {
         for (Map.Entry<Long, Long> entry : map.entrySet())
            pr.println("Key => " + entry.getKey() + ", Value => " + entry.getValue());
      }
   }

   public static void debugmapIL(HashMap<Integer, Long> map) {
      if (sysFlag) {
         for (Map.Entry<Integer, Long> entry : map.entrySet())
            pr.println("Key => " + entry.getKey() + ", Value => " + entry.getValue());
      }
   }

   public static void debugmapSL(HashMap<String, Long> map) {
      if (sysFlag) {
         for (Map.Entry<String, Long> entry : map.entrySet())
            pr.println("Key => " + entry.getKey() + ", Value => " + entry.getValue());
      }
   }

   public static void debugmapCL(HashMap<Character, Long> map) {
      if (sysFlag) {
         for (Map.Entry<Character, Long> entry : map.entrySet())
            pr.println("Key => " + entry.getKey() + ", Value => " + entry.getValue());
      }
   }

   public static void debugmapSI(HashMap<String, Integer> map) {
      if (sysFlag) {
         for (Map.Entry<String, Integer> entry : map.entrySet())
            pr.println("Key => " + entry.getKey() + ", Value => " + entry.getValue());
      }
   }

   public static void debugmapCI(HashMap<Character, Integer> map) {
      if (sysFlag) {
         for (Map.Entry<Character, Integer> entry : map.entrySet())
            pr.println("Key => " + entry.getKey() + ", Value => " + entry.getValue());
      }
   }

}
