#WOWSUBSTR. Counting WOW-Substrings

Counting WOW-Substrings

You are given a string. You have to count the total length of all WOW substrings. WOW substrings are defined as a contiguous substring of a string where there is not any character occurring more than one times. That means, all the characters of substring are unique.

As the answer could be very large, print it modulo 100007. (Note: 100007 is not a prime number.)

Input

Input starts with an integer T, denoting the number of test cases. Each case starts with a string S. All the characters in the string will be lowercase letters of the English alphabet.

Output

For each case, print the case number and total length of all WOW substrings of given string modulo 100007.

Constraints

1 <= T <= 50.

1 <= |S| <= 500000. (Length of string)

Example

Input:
2
aaa
ab

Output: Case 1: 3 Case 2: 4

</p>