Stacy loves playing with numbers. She made a sequence of digits and wrote down all its valid sub-segments as a new array .
A sub-segment is defined here as a consecutive part of an -digit sequence. Sub-segments with leading zeros are not valid. For example valid sub-segments of the sequence are . Note that is a valid sub-segment, but is not.
Stacy sorts her new array in ascending order, about which she has questions. question is,"Which number is ?" (In other words, which number is in position in array ?)
Help Stacy answer her questions and print each modulo on a new line.
Note: Position of array starts from .
Input Format
The first line contains (size of the sequence) and (number of questions).
The second line contains digits (Stacy's initial sequence).
The subsequent lines each contain a question: an integer corresponding to some index .
Constraints
It's guaranteed that the number exists.
for
Output Format
For each question, find the number in index and print the modulo on a new line.
Sample Input
5 5
12012
1
4
6
8
12
Sample Output
0
2
12
20
2012
Explanation
Stacy's sorted numbers are: .
number is ,
number is ,
number is ,
number is ,
number is .