#P1385. 密令
密令
Description
Given a lowercase string , in each operation you may choose a position () and perform one of the following modifications:
- Change to the letter with lexicographic order , and change to the letter with lexicographic order .
- Change to the letter with lexicographic order , and change to the letter with lexicographic order .
After performing any number of operations, into how many different strings can be transformed?
During the modifications, must always remain a valid lowercase string (that is, you cannot apply lexicographic to the letter 'a', and you cannot apply lexicographic to the letter 'z'). Output the answer modulo .
Input Format
The first line contains an integer , the number of test cases.
The next lines each contain a lowercase string .
Output Format
Output lines, each containing one integer, the answer for the corresponding test case.
3
aaaaaaaaa
ya
klmbfxzb
0
24
320092793
Hint
- For of the testdata, , .
- For of the testdata, .
- For of the testdata, , .
Translated by ChatGPT 5
京公网安备 11011102002149号