406057: GYM102253 B Balala Power!
Description
Talented Mr. Tang has $$$n$$$ strings consisting of only lowercase letters. He wants to charge them with Balala Power (he could change each letter ranged from 'a' to 'z' into any number ranged from $$$0$$$ to $$$25$$$, but every two different letters must not be changed into the same number) so that he could casually calculate the sum of these strings as integers in the base of $$$26$$$.
Mr. Tang wants you to maximize the sum. Note that no string in this problem can have any leading zeros when regarded as integers, except for the string "0". Therefore, he guarantees that at least one type of letter would not appear at the beginning of any given string.
The sum may be quite large, so you should output it modulo $$$(10^9 + 7)$$$ instead.
InputThe input contains multiple (about $$$20$$$) test cases.
For each test case, the first line contains an integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$), indicating the number of strings.
The $$$i$$$-th of the next $$$n$$$ lines contains a string $$$s_i$$$ ($$$1 \leq |s_i| \leq 10^5$$$) consisting of only lowercase letters. It is guaranteed that $$$\sum_{i = 1}^{n}{|s_i|} \leq 10^6$$$ for each test case.
OutputFor each test case, output "Case #x: y" in one line (without quotes), where $$$x$$$ indicates the case number starting from $$$1$$$, and $$$y$$$ denotes the answer to the corresponding case.
ExampleInput1 a 2 aa bb 3 a ba abcOutput
Case #1: 25 Case #2: 1323 Case #3: 18221