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.
/*
TO LEARN
1-segment trees
2-euler tour
3-fenwick tree and interval tree
*/
            import java.util.*;
		    import java.math.*;
		    import java.io.*; 
		    import java.util.stream.Collectors;
 
		     public class A{
		     
		    static FastReader scan=new FastReader();
		     public static PrintWriter out = new PrintWriter (new BufferedOutputStream(System.out));
	static long gcd(long a,long b)
	{
		if(b==0)
			return a;
		return gcd(b,a%b);
	}
	static BigInteger lcm(BigInteger a,BigInteger b){
		return ((a.multiply(b)).divide(a.gcd(b)));
	}
		    public static void main(String[] args)  throws Exception 
		    {
	
		    //scan=new FastReader("vs.txt");
		    //out = new PrintWriter("hps.out");
		 
		 /*
		 currently doing 
		 1-digit dp
		 2-ds like fenwick and interval tree

		 */

		    int tt=1;
//tt=scan.nextInt();
	 outer:while(tt-->0)
		    {
		    	int n=scan.nextInt(),q=scan.nextInt();
		    	int arr[][]=new int[26][n];
		    
		    String s=scan.next();
		    for(char c='a';c<='z';c++)
		    {
		    	for(int i=0;i<s.length();i++)
		    	{
		    		if(s.charAt(i)==c)
		    		{
		    			arr[c-'a'][i]=1;
		    		}
		    	}
		    	for(int i=1;i<s.length();i++)
		    	{
		    		arr[c-'a'][i]+=arr[c-'a'][i-1];
		    	}
		    }
		   // out.println(arr[1][4]-arr[1][0]);
		    for(int i=0;i<q;i++)
		    {
		    	int l=scan.nextInt()-1,r=scan.nextInt()-1;
		    	long res=0;
		    	for(char c='a';c<='z';c++)
		    	{
		    		if(l==0)
		    		{
		    			long k=arr[c-'a'][r];
		    			long num=(c-'a')+1;
		    			//out.println((k*num)+" "+c+" "+k);
		    			res+=(k*num);
		    		}
		    		else 
		    		{
		    				long k=arr[c-'a'][r]-arr[c-'a'][l-1];
		    			long num=(c-'a')+1;
		    			//out.println((k*num)+" "+c+" "+k);
		    			res+=(k*num);
		    		}

		    	}
		    	out.println(res);
		    }


		    
		    }



		  	    out.close();
		    }
		    static class special implements Comparable<special>{
		        int x,y;
		        String s;
		        special(int x,int y,String s)
		        {
		            this.x=x;
		           this.y=y;
		           this.s=s;
		        }
		     
		     @Override
		            public boolean equals(Object o){
		                if (o == this) return true;
		                if (o.getClass() != getClass()) return false;
		                special t = (special)o;
		                return t.x == x && t.y == y&&t.s.equals(s);
		            }
		     
		    public int compareTo(special o)
		    {
		        return Integer.compare(x,o.x);
		    }
		    }
		    static long binexp(long a,long n)
		    {
		        if(n==0)
		            return 1;
		        long res=binexp(a,n/2);
		        if(n%2==1)
		            return res*res*a;
		        else 
		            return res*res;
		    }
		     
		    static long powMod(long base, long exp, long mod) {
		           if (base == 0 || base == 1) return base;
		           if (exp == 0) return 1;
		           if (exp == 1) return (base % mod+mod)%mod;
		           long R = (powMod(base, exp/2, mod) % mod+mod)%mod;
		           R *= R;
		           R %= mod;
		           if ((exp & 1) == 1) {
		               return (base * R % mod+mod)%mod;
		           }
		           else return (R %mod+mod)%mod;
		       }
		    static double dis(double x1,double y1,double x2,double y2)
		    {
		        return Math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
		    }
		    static long mod(long x,long y)
		        {
		            if(x<0)
		                x=x+(-x/y+1)*y;
		            return x%y;
		        }
		     public static  long pow(long b, long e) {
		                long r = 1;
		                while (e > 0) {
		                    if (e % 2 == 1) r = r * b ;
		                    b = b * b;
		                    e >>= 1;
		                }
		                return r;
		            }
		    private static void sort(long[] arr) {
		            List<Long> list = new ArrayList<>();
		            for (long object : arr) list.add(object);
		            Collections.sort(list);
		        //Collections.reverse(list);
		            for (int i = 0; i < list.size(); ++i) arr[i] = list.get(i);
		        }
		    private static void sort2(int[] arr) {
		            List<Integer> list = new ArrayList<>();
		            for (int object : arr) list.add(object);
		            Collections.sort(list);
		        Collections.reverse(list);
		            for (int i = 0; i < list.size(); ++i) arr[i] = list.get(i);
		        }
		     public static class FastReader {
		            BufferedReader br;
		            StringTokenizer root;
		            
		     
		            public FastReader() {
		                br = new BufferedReader(new InputStreamReader(System.in));
		            }
		            FastReader(String filename)throws Exception
		            {
		     
		                br=new BufferedReader(new FileReader(filename));
		            }
		     
		            boolean hasNext(){
		                String line;
		                while(root.hasMoreTokens())
		                    return true;
		                return false;
		            }
		     
		            String next() {
		                while (root == null || !root.hasMoreTokens()) {
		                    try {
		                        root = new StringTokenizer(br.readLine());
		                    } catch (Exception addd) {
		                        addd.printStackTrace();
		                    }
		                }
		                return root.nextToken();
		            }
		     
		            int nextInt() {
		                return Integer.parseInt(next());
		            }
		     
		            double nextDouble() {
		                return Double.parseDouble(next());
		            }
		     
		            long nextLong() {
		                return Long.parseLong(next());
		            }
		     
		            String nextLine() {
		                String str = "";
		                try {
		                    str = br.readLine();
		                } catch (Exception addd) {
		                    addd.printStackTrace();
		                }
		                return str;
		            }
		             public int[] nextIntArray(int arraySize) {
		                int array[] = new int[arraySize];
		     
		                for (int i = 0; i < arraySize; i++) {
		                    array[i] = nextInt();
		                }
		     
		                return array;
		            }
		    }
		     static class Pair implements Comparable<Pair>{
		            public long x, y,z;
		            public Pair(long x1, long y1,long z1) {
		                x=x1;
		                y=y1;
		                z=z1;
		            }
		             public Pair(long x1, long y1) {
		                x=x1;
		                y=y1;
		    
		            }
		            
		            @Override
		            public int hashCode() {
		                return (int)(x + 31 * y);
		            }
		            public String toString() {
		                return x + " " + y+" "+z;
		            }
		            @Override
		            public boolean equals(Object o){
		                if (o == this) return true;
		                if (o.getClass() != getClass()) return false;
		                Pair t = (Pair)o;
		                return t.x == x && t.y == y&&t.z==z;
		            }
		    public int compareTo(Pair o)
		    {return (int)(x-o.x);
		     
		        }
		     
		    }
		     static class tuple{
		            int x,y,z;
		            tuple(int a,int b,int c){
		                x=a;
		                y=b;
		                z=c;
		            }
		        }
		        static class Edge{
		            int d,w;
		            Edge(int d,int w)
		            {
		                this.d=d;
		                this.w=w;
		            }
		        }
		    }

		     
