Lily White is playing with strings. Being a yousei, she is not capable of complex speech. Thus, she likes strings that only contain one kind of letter, she calls such strings of length a "-CON string". For example, qqqq is a "-CON string", while aaab is not any type of "CON string".
Lily White composed an array . It contains strings of length that she will use to herald spring. For each permutation of , let us denote current permutation as . Lily White concatenates all the string in array in the order of into a string of length .
As she likes -CON strings, she wants to know the sum of the number of "-CON string" in all non-empty substrings of composed by all permutations. Since the answer may be enormous, just print the answer taken modulo (a large prime).
输入格式
The first line contains three integers .
Then lines follow, each line contains a string of length . The string in the-th line represents .
输出格式
Print a single integer - the answer taken modulo .
样例
样例输入 1
3 3 5
aaa
baa
baa
样例输出 1
4
样例输入 2
3 3 2
xyz
qaq
aba
样例输出 2
0
样例输入 3
5 3 2
cca
cbb
acb
bbb
acb
样例输出 3
600
样例输入 4
5 3 5
aba
bbb
bbb
aba
bcb
样例输出 4
120
数据范围与提示
Explanation
Sample #1
For permutation , the formed is aaabaabaa, none on the non-empty substring in this string are "-CON string".
For permutation , the formed is aaabaabaa, none on the non-empty substring in this string are "-CON string".
For permutation , the formed is baaaaabaa, this string has one substring aaaaa which is a "-CON string".
For permutation , the formed is baabaaaaa, this string has one substring aaaaa which is a "-CON string".
For permutation , the formed is baaaaabaa, this string has one substring aaaaa which is a "-CON string".
For permutation , the formed is baabaaaaa, this string has one substring aaaaa which is a "-CON string".
In summary, the answer is .
Sample #2
In all of the full permutation of length , there will be six different : xyzqaqaba, xyzabaqaq, qaqxyzaba, qaqabaxyz, abaqaqxyz, and abaxyzqaq. None of these has a non-empty substrings which is a "-CON string". So the answer is .