CSES - KILO 2018 3/5 - Alphabet Accumulation
  • Time limit: 2.00 s
  • Memory limit: 512 MB

You are given a string ss of length nn and a list of mm words. Your task is to calculate for each prefix of ss the number of words that can be formed using its letters.

For example, if the prefix is aabaab and the words are aaaa, baba, bbbb, you can form both aaaa and baba, since there are two aa's and one bb, but not bbbb, since there is only one bb.

Input

The first line contains two integers nn and mm: the length of ss and the words in the list. The second line contains a string ss of length nn. Finally, there are mm lines, each containing a word.

Output

Output nn integers, where the ii'th is the amount of words that can be formed using the letters in the prefix of length ii of ss.

Constraints

  • 1n1051 \leq n \leq 10^{5}
  • 1m1051 \leq m \leq 10^{5}
  • the total length of the mm words is at most 10610^{6}
  • all letters are lowercase English letters (aza \dots z)

Example

Input:

3 3
aab
aa
ba
bb

Output:

0 1 2

Explanation:

  • With letters aa (one aa), you cannot form any words.
  • With letters aaaa (two aa's), you can form aaaa, but not baba or bbbb since there are no bb's.
  • With letters aabaab (two aa's and one bb), you can form both aaaa and baba, but not bbbb, since there is only one bb.