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 JAVA):

Solution:
//********************(Writer-Aagam)*******************************
//*******************(User-getlost01)******************************

import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.BigInteger;

//------------------------Main_class-------------------------------

public class Codechef
{
static AagamReader ar=new AagamReader();
   
//----------------------Main_Function------------------------------

public static void main (String[] args) throws java.lang.Exception
{
// long start=System.currentTimeMillis();

int n=ar.nextInt();
int q=ar.nextInt();
String s=ar.next();
// int arr[][]=new int[n+1][26];
// for(int i=0;i<n;i++)
// {
//     int temp=(int)(s.charAt(i))-97;
//     for(int j=0;j<26;j++)
//     {
//         if(j==temp)
//     arr[i+1][temp]=1+arr[i][temp];
//     else
//     arr[i+1][j]=arr[i][j];
//     // System.out.print(arr[i+1][j]+" ");
//     }
//     // System.out.println();
// }
// while(q-->0)
// {
// int l=ar.nextInt();   
// int r=ar.nextInt();
// long sum;
// if(r==l)
// sum=(int)(s.charAt(l-1))-96;
// else 
// sum=(int)(s.charAt(r-1))-96+(int)(s.charAt(l-1))-96;
// if(r-1>=l+1)
// {
// for(int i=0;i<26;i++)
// {
// if(i!=(int)(s.charAt(r-1))-97&&i!=(int)(s.charAt(l-1))-97)    
// sum+=(arr[r-1][i]-arr[l][i])*(i+1);
// }
// }
// System.out.println(sum);
// }


int arr[]=new int[n+1];
for(int i=1;i<=n;i++)
{
int temp=(int)(s.charAt(i-1))-96;
arr[i]=arr[i-1]+temp;
}          
while(q-->0)
{
int l=ar.nextInt();
int r=ar.nextInt();
System.out.println(arr[r]-arr[l-1]);
}

// long end=System.currentTimeMillis();
// System.out.println(end-start+" Millisec");
}

//--------------------Solving_Function---------------------------

static void solve(String s)
{


System.out.println(s);
}
//------------------------Reverse----------------------------------

public static int[] reverses(int data[], int left, int right)
{
while (left < right) 
{
int temp = data[left];
data[left++] = data[right];
data[right--] = temp;
}
return data;
}

//----------------------------Swap-----------------------------------

public static int[] swap(int data[], int left, int right) 
{
int temp = data[left];
data[left] = data[right];
data[right] = temp;
return data;
}

//--------------------------Factorial---------------------------------

public static long factorials(long n)
{
if(n==0) return 1; 

return n*factorials(n-1);
}

//-------------------------G.C.D---------------------------------------

public static long gcd(long a,long b)
{
if(b==0) return a;

return gcd(b,a%b);
}

//-------------------------ModularG.C.D-------------------------------

static long gcd(long a,long b,long n,long mod)
{
if(a==b)
return (mod_expo(a,n,mod)+mod_expo(b,n,mod))%mod;

long c=1;long diff=a-b;

for(long i=1;i<=Math.sqrt(diff);i++)
{
if(diff%i==0)
{
long temp=(mod_expo(a,n,i)+mod_expo(b,n,i))%i;
if(temp==0)
c=Math.max(c,i);

temp=(mod_expo(a,n,diff/i)+mod_expo(b,n,diff/i))%(diff/i);
if(temp==0)
c=Math.max(c,diff/i);
}
}
return c%mod;
}

//------------------------ l.C.M--------------------------------------
public static long lcm(long a,long b)
{
return (a*b)/gcd(a,b);
}
//---------------------------Prime-----------------------------------

public static boolean[] seive(int n)
{
boolean isPrime[]=new boolean[n+1];
Arrays.fill(isPrime,true);
isPrime[0]=false;
isPrime[1]=false;
for(int i=2;i*i<=n;i++)
{
for(int j=2*i;j<=n;j+=i)
{
isPrime[j]=false;
}
}
return isPrime;
}

//----------------------Modular_Exponentiation-------------------------

static long mod_expo(long a,long b,long n)
{
long res=1;
while(b>0)
{
if((b&1)!=0)
{res=(res*a%n)%n;}

a=(a%n*a%n)%n;
b=b>>1;
}
return res;
}

//-------------------------Power-----------------------------------------

static int fastpower(int a,int b)
{
int res=1;
while(b>0)
{
if((b&1)!=0)
res=res*a;

a=a*a;
b=b>>1;
}
return res;
}

//---------------------Modular_Arithmetic---------------------------------

public long modularSubtraction(long a,long b,long MOD)    // Modular Subtraction
{ return (a%MOD-b%MOD+MOD)%MOD; }

public long modularMultiplication(long a,long b,long MOD) // Modular Multiplication
{ return ((a%MOD)*(b%MOD))%MOD; }

public long modularAddition(long a,long b,long MOD)       // Modular Addition
{ return (a%MOD+b%MOD)%MOD; }	

//-----------------------Binary_Searching-----------------------------------

public static int binarySearch(int arr[], int first, int last, int num)
{
int mid = (first + last) / 2;
while (first <= last)
{
if (arr[mid] < num) {first = mid + 1;} 
else if (arr[mid] == num) {return mid;}
else {last = mid - 1;}
mid = (first + last) / 2;
}
return -1;
}

//-------------------------------------Node-------------------------------- 

static class Node<E>             
{
protected E data;
protected Node link;  //link====>next/linked address

public Node() {data=null; link=null;}

public Node(E d,Node n) {data=d; link=n;}  

public void setLink(Node n) {link=n;}

public void setData(E d) {data=d;}

public Node getLink() {return link;}

public E getData() {return data;}
}

//--------------------------------------Aaagmlist-----------------------------

static class aagamList<E>
{
protected Node start;
protected Node end;
public int size;

public aagamList() {start=null;end=null;size=0;}

public boolean isEmpty() {return start==null;}

public int size() {return size;}

public E get(int pos)
{ Node<E> curr=start; int c=0;
  while(curr!=null) {if(c==pos) return curr.data; c++; curr=curr.link;}
  return null;}

public void push_lr(E val) { Node<E> cnode=new Node<>(val,null); cnode.link=start; start=cnode;}

public void prepend(E val)
{ Node<E> cnode=new Node<E>(val,null); size++;
  if(start==null) {start=cnode;end=start;} 
  else {cnode.setLink(start);start=cnode;}
}

public void append(E val)
{ Node<E> cnode=new Node<E>(val,null); size++;
  if(start==null) {start=cnode;end=start;} 
  else {end.setLink(cnode);end=cnode;}
}

public void insert(E val,int pos)
{ Node<E> cnode=new Node<>(val,null); Node temp=start; --pos;
  for(int i=1;i<size;i++)
  { if(i==pos) {Node tmp=temp.getLink(); temp.setLink(cnode); cnode.setLink(tmp); break;}
    temp=temp.getLink(); } size++;
}

public void remove(int pos)
{ if(pos==1) {start=start.getLink(); size--; return;}
  if(pos==size) {Node s=start; Node t=start; while(s!=end) {t=s; s=s.getLink();}
  end=t; end.setLink(null); size--; return;}
  Node temp=start; --pos;
  for(int i=0;i<size-1;i++) 
  { if(i==pos) {Node tmp=temp.getLink(); tmp=tmp.getLink(); temp.setLink(tmp); break;}
  temp=temp.getLink(); }size--; 
}

public void display()
{ if(size==0) {System.out.println(" "); return;}
  if(start.getLink()==null) {System.out.println(start.getData()); return;}
  Node<E> temp=start; System.out.print(temp.getData()+" ");
  temp=start.getLink();
  while(temp.getLink()!=null) {System.out.print(temp.getData()+" "); temp=temp.getLink();}
  System.out.print(temp.getData()+"\n");
}
}

//----------------------------------------Stack------------------------------

static class Astack<E>
{
aagamList<E> a=new aagamList<>();
public void push(E val) {a.append(val); return;}
public void pop() {a.remove(a.size()-1); return;}
public void display() {a.display(); return;}
}

//---------------------------------------Dequeue------------------------------

static class Adequeue<E>
{
aagamList<E> a=new aagamList<>();
public void push_f(E val) {a.prepend(val); return;}
public void push_b(E val) {a.append(val); return;}
public void pop_f() {a.remove(0); return;}
public void pop_b() {a.remove(a.size()-1); return;}
public void display() {a.display(); return;}
}

//-----------------------AagamReader_class------------------------------------

public static class AagamReader 
{
BufferedReader br;
StringTokenizer st;

public AagamReader()
{
br = new BufferedReader(new InputStreamReader(System.in));
}

String next()                                           //ReadNextToken
{
while (st == null || !st.hasMoreElements()) 
{
try 
{
st = new StringTokenizer(br.readLine());
}
catch (IOException e) {e.printStackTrace();}
}
return st.nextToken();
}

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

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

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

int[] get_arr(int n)                                      //ReadArray
{
int arr[]=new int [n];
for(int i=0;i<n;i++)
arr[i]= Integer.parseInt(next());
return arr;
}

String nextLine()                                         //Readline
{
String str = "";
try 
{ 
str = br.readLine(); 
}
catch (IOException e) 
{
e.printStackTrace();
}
return str;
}
}
}
//=>->->->-->->->-[>>>>>>ENDING_WITH_HAPPY_CODING<<<<<<]-<-<-<-<-<-<-<-<-<-<=