Games with words and strings are very popular lately. Now Edsger tries to create a similar new game of his own. Here is what he came up with so far.
Edsger's new game is called Palindromic Deletions. As a player of this game, you are given a string of length N. Then you will perform the following process N times:
Now Edsger wonders: given a starting string, what is the expected number of candies you will eat during the game?
The first line of the input gives the number of test cases, T. T test cases follow. Each test case consists of two lines.
The first line of each test case contains an integer N, representing the length of the string.
The second line of each test case contains a string S of length N, consisting of lowercase English characters.
For each test case, output one line containing Case #x: E, where x is the test case number (starting from 1) and E is the expected number of candies you will eat during the game.
E should be computed modulo the prime 109+7 (1000000007) as follows. Represent the answer of a test case as an irreducible fraction qp. The number E then must satisfy the modular equation E×q≡p(mod(109+7)), and be between 0 and 109+6, inclusive. It can be shown that under the constraints of this problem, such a number E always exists and can be uniquely determined.