Professional Documents
Culture Documents
Marc is young lover of strings who wants your help with the following problem. Given a string, , of
lowercase English alphabetic letters and an integer, , calculate the number of string 's such that:
Each
Input Format
The first line contains a string denoting .
The second line contains an integer denoting
Constraints
to ).
Output Format
Print the number of string 's satisfying the conditions above, modulo
Sample Input
abc
6
Sample Output
2
Explanation
Given
1.
abc
2.
abcabc .
Thus, we print
on a new line.
and