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:
try:
    import sys
#     from _future_ import division, print_function
#     import bisect 
    import math
    # import heapq
    import collections
#     i_m = 9223372036854775807
    M = 10**9+7
    
    # def matrix(n):
    #     #matrix input
    #     return [list(map(int, input().split()))for i in range(n)]
    
#     def string2intlist(s):
#         return list(map(int, s))
    
    
#     def calculate_sum(a, N):  # sum of a to N
#         # Number of multiples
#         m = N / a
#         # sum of first m natural numbers
#         sum = m * (m + 1) / 2
#         # sum of multiples
#         ans = a * sum
#         return ans
    
    
#     def series(N):
#         return (N*(N+1))//2
    
    
#     def count2Dmatrix(i, list):
#         return sum(c.count(i) for c in list)
    
    
#     def modinv(n, p):
#         return pow(n, p - 2, p)
    
    
#     def nCr(n, r):
#         i = 1
#         while i < r:
#             n *= (n - i)
#             i += 1
#         return n // math.factorial(r)
    
    
#     def GCD(x, y):
#         x = abs(x)
#         y = abs(y)
#         if(min(x, y) == 0):
#             return max(x, y)
#         while(y):
#             x, y = y, x % y
#         return x
    
    
#     def LCM(x, y):
#         return (x * y) // GCD(x, y)
    
    
    # def Divisors(n):
    #     l = []
    #     for i in range(1, int(math.sqrt(n) + 1)):
    #         if (n % i == 0):
    #             if (n // i == i):
    #                 l.append(i)
    #             else:
    #                 l.append(i)
    #                 l.append(n//i)
    #     return l
    
    
    # def isprime(n):
    #     for i in range(2, int(math.sqrt(n))+1):
    #         if n % i == 0:
    #             return False
    #     return True

    # def isprime(n): 
    #     if(n <= 1): 
    #         return False
    #     if(n <= 3): 
    #         return True
    #     if(n % 2 == 0 or n % 3 == 0): 
    #         return False
    #     for i in range(5,int(math.sqrt(n) + 1), 6): 
    #         if(n % i == 0 or n % (i + 2) == 0): 
    #             return False 
    #     return True

   
    # maxn  = 1000100
    # def SieveOfEratosthenes():
    #     prime = [True for i in range(maxn+1)]
    #     prime[0] = False
    #     prime[1] = False
    #     p = 2
    #     while (p * p <= maxn):
    #         if (prime[p] == True):
    #             for i in range(p * p, maxn+1, p):
    #                 prime[i] = False
    #         p += 1
    #     return prime
    
    
#     q = []
    
    
#     def dfs(n, d, v, c):
#         global q
#         v[n] = 1
#         x = d[n]
#         q.append(n)
#         j = c
#         for i in x:
#             if i not in v:
#                 f = dfs(i, d, v, c+1)
#                 j = max(j, f)
#                 # print(f)
#         return j
#     # d = {}
    
    
#     def knapSack(W, wt, val, n):
#         K = [[0 for x in range(W + 1)] for x in range(n + 1)]
#         for i in range(n + 1):
#             for w in range(W + 1):
#                 if i == 0 or w == 0:
#                     K[i][w] = 0
#                 elif wt[i-1] <= w:
#                     K[i][w] = max(val[i-1] + K[i-1][w-wt[i-1]],  K[i-1][w])
#                 else:
#                     K[i][w] = K[i-1][w]
    
#         return K[n][W]
    
    
    # def modularExponentiation(x, n):
    #     if(n == 0):
    #         return 1
    #     elif (n % 2 == 0):  # n is even
    #         return modularExponentiation((x*x) % M, n//2)
    #     else:  # n is odd
    #         return (x * modularExponentiation((x * x) % M, (n - 1) // 2)) % M
    
     # def powerOftwo(n):
    #     return n and (not (n & (n-1)))
    
#     def modInverse(a, m):
#         m0 = m
#         y = 0
#         x = 1
    
#         if (m == 1):
#             return 0
    
#         while (a > 1):
    
#             # q is quotient
#             q = a // m
    
#             t = m
    
#             # m is remainder now, process
#             # same as Euclid's algo
#             m = a % m
#             a = t
#             t = y
    
#             # Update x and y
#             y = x - q * y
#             x = t
    
#         # Make x positive
#         if (x < 0):
#             x = x + m0
    
#         return x
    # temp = [0]*101 
#     def mapi(l,r):
#         idx = -1
#         val = -1
#         if(l > r):
#             return 0
#         if(l == r):
#             return l
#         for l in range(l,r+1):
#             if temp[l]>val:
#     	        idx = l
#     	        val = temp[l]
#         return idx
    def fillPrefixSum(arr, n, prefixSum):
        prefixSum[0] = arr[0]
        for i in range(1, n):
            prefixSum[i] = prefixSum[i - 1] + arr[i]
 
    def solve():
        # x = int(input())
        # d = collections.defaultdict(list)
        # n,k = map(int,input().split())
        # t1 = list(map(int,input().split()))
        # temp = modularExponentiation(2,n)-1
        length , q  =map(int,input().split())
        string = input()
        string = string.replace('\r' , '')
        d = {}
        count = 1
        for i in range(97 , 123):
            d[chr(i)] = count
            count += 1
            
        arr = []
        for i in string:
            arr.append(d.get(i))
        # print(arr)
        prefixSum = [0 for i in range(length)]
        fillPrefixSum(arr, length, prefixSum)
        # print(prefixSum)
        for i in range(q):
            a ,b = map(int,input().split())
            total = prefixSum[b-1] - prefixSum[a-1] + arr[a-1]
            print(total)
        return
    # test = int(input())
    count1 = 1
    
    # while count1<=test:
    solve()
        # sys.stdout.write("Case #" + str(count1) + ": " + str(ans) + "\n")
    # sys.stdout.write(str(ans) + "\n")
        # count1 += 1
except EOFError:
    print("")