Yousef has a string s that is used to build a magical string w by repeating the string s infinitely many times. For example, if s = aabbb , then w = aabbbaabbbaabbbaabbb....
Mohammad always claims that his memory is strong, and that his ability to count is very high, so Yousef decided to hold a test for Mohammad, in order to know the truth of his claims.
Yousef will give Mohammad q queries, such that each query consisting of two integers l and r, and a lowercase English letter c. The answer of each query is how many times the letter c appears between the lth and rth letters in *string w*.
Mohammad must answer all the queries correctly, in order to proof his claims, but currently he is busy finishing his meal. Can you help Mohammad by answering all queries?
The first line contains an integer T, where T is the number of test cases.
The first line of each test case contains two integers n and q (1 ≤ n ≤ 104) (1 ≤ q ≤ 105), where n is the length of string s, and q is the number of queries.
The second line of each test case contains the string s of length n consisting only of lowercase English letters.
Then q lines follow, each line contains two integers l and r and a lowercase English letter c (1 ≤ l ≤ r ≤ 109), giving the queries.
For each query, print a single line containing how many times the letter c appears between the lth and rth letters in *string w*.
As input/output can reach huge size it is recommended to use fast input/output methods: for example, prefer to use _scanf/printf_ instead of _cin/cout_ in C++, prefer to use _BufferedReader/PrintWriter_ instead of _Scanner/System.out_ in Java.
## Input
The first line contains an integer T, where T is the number of test cases.The first line of each test case contains two integers n and q (1 ≤ n ≤ 104) (1 ≤ q ≤ 105), where n is the length of string s, and q is the number of queries.The second line of each test case contains the string s of length n consisting only of lowercase English letters.Then q lines follow, each line contains two integers l and r and a lowercase English letter c (1 ≤ l ≤ r ≤ 109), giving the queries.
## Output
For each query, print a single line containing how many times the letter c appears between the lth and rth letters in *string w*.
[samples]
## Note
As input/output can reach huge size it is recommended to use fast input/output methods: for example, prefer to use _scanf/printf_ instead of _cin/cout_ in C++, prefer to use _BufferedReader/PrintWriter_ instead of _Scanner/System.out_ in Java.
**Definitions**
Let $ T \in \mathbb{Z}^+ $ be the number of test cases.
For each test case:
- Let $ n \in \mathbb{Z}^+ $ be the length of the base string $ s $.
- Let $ s = s_1 s_2 \dots s_n \in \Sigma^n $, where $ \Sigma $ is the set of lowercase English letters.
- Let $ w $ be the infinite string defined by $ w = s^\infty $, i.e., $ w_i = s_{(i-1) \bmod n + 1} $ for all $ i \geq 1 $.
- Let $ q \in \mathbb{Z}^+ $ be the number of queries.
**Constraints**
1. $ 1 \leq T \leq \text{unknown (implied by input)} $
2. For each test case:
- $ 1 \leq n \leq 10^4 $
- $ 1 \leq q \leq 10^5 $
- $ 1 \leq l \leq r \leq 10^9 $
**Objective**
For each query $ (l, r, c) $, compute:
$$
f(l, r, c) = \sum_{i=l}^{r} \mathbf{1}_{w_i = c}
$$
where $ \mathbf{1}_{w_i = c} = 1 $ if $ w_i = c $, and $ 0 $ otherwise.