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

Solution:
from timeit import timeit
import os,sys
from datetime import datetime
from math import floor,ceil,sqrt,gcd,factorial
from collections import Counter,defaultdict
import bisect
def readint():
    return int(sys.stdin.readline())
def readstr():
    return sys.stdin.readline()
def readlst():
    return list(map(int, sys.stdin.readline().strip().split()))
def readmul():
    return map(int, sys.stdin.readline().strip().split())
def mulfloat():
    return map(float, sys.stdin.readline().strip().split())
def flush():
    return sys.stdout.flush()
def power_two(x):
    return (1<<x)
def lcm(a,b):
    return a*b//gcd(a,b)
INF=float('inf')
mod=int(1e9)+7
#counts element greater than value in array
def countGreater(arr,n, k):
    l = 0
    r = n - 1
    leftGreater = n
    while (l <= r):
        m = int(l + (r - l) / 2)
        if (arr[m] >= k):
            leftGreater = m
            r = m - 1
        else:
            l = m + 1
            return (n - leftGreater)

def two_pointer(n,val,*arr):
    l,r,cnt=0,n-1,0
    while l<r:
        if arr[l]+arr[r]>val:
            r-=1
        else:
            cnt+=r-l
            l+=1
    return cnt

def lower(arr,n,val):
    l,r=-1,n
    while r>l+1:
        m=int((l+r)>>1)
        if arr[m]<val:
            l=m
        else:
            r=m
    return r

def upper(arr,n,val):
    l,r=-1,n
    while r>l+1:
        m=int((l+r)>>1)
        if arr[m]<=val:
            l=m
        else:

            r=m
    return l


def binpow(a,n,mod):
    while n:
        if n&1:
            res=(res*a)%mod
            n-=1
        a=(a*a)%mod
        n=n>>1
    return res

def check(s):
    cnt=0
    for i in s:
        if i=='(':
            cnt+=1
        elif i==')':
            cnt-=1
    #print('Cnt',cnt)
    return cnt==0

def omkar():
    n,q=readmul()
    s=input()
    hsh=[0]*(n+1)
    for i in range(0,n):
        hsh[i+1]=ord(s[i])-ord('a')+1
    #print(hsh)
    for i in range(1,n+1):
        hsh[i]+=hsh[i-1]
    #print(hsh)
    for i in range(q):
        l,r=readmul()
        print(hsh[r]-hsh[l-1])
    return














def main():
    #test=readint()
    test=1
    while test:
        omkar()
        test-=1
main()