Carlos has invented a new language! his new language is called aaegglnu. This new language has the weird characteristic that in each word, all letters are read at the same time! He now wants to teach aaegglnu to his students, and for this he first need to create an ordering for his language and he has decided on the following:
Lets define function $$$f$$$ which given a string $$$S$$$ returns another string $$$S'$$$ which has the same characters as $$$S$$$ but with the characters ordered. For example $$$f(\text{'language'}) = \text{'aaegglnu'}$$$. so in the ordering of aaegglnu, word $$$A$$$ goes before $$$B$$$ if lexicografically $$$f(A)$$$ goes before $$$f(B)$$$. In the case that $$$f(A)=f(B)$$$, $$$A$$$ goes before $$$B$$$ if lexicografically $$$A$$$ is smaller than $$$B$$$.
His students are however still a bit slow when looking for a word in the dictionary Carlos made, so they have asked for your help in this.
In the first line $$$N$$$ ($$$1\leq N\leq 100000$$$) in the next $$$N$$$ lines there will be given $$$N$$$ words.
On the ($$$i+1$$$)-th line the word $$$a_i$$$ from the dictionary($$$1\leq |a_i|\leq 100$$$) which are made from lowercase letters from the english alphabet.
It is assured that the sum of the lengths of the $$$N$$$ words is less than $$$1000000$$$.
In the next line there will be one number $$$Q$$$ ($$$1\leq Q\leq 100000$$$), the number of queries you'll have to answer.
In the next $$$Q$$$ lines there will be one word, $$$b_i$$$ ($$$1\leq |b_i| \leq 100$$$) made of lowercase letters from the english alphabet.
It is assured that the sum of the lengths of the $$$Q$$$ words, is less than $$$1000000$$$.
You'll have to print $$$Q$$$ lines, on the i-th line you'll print how many words from the dictionary are smaller or equal to word $$$b_i$$$
5languageabcddcbaaaegglnub3bcdacegglnuaa
3 5 1
| Name |
|---|


