Problems
Cody-Jamal is working on his latest piece of abstract art: a mural consisting of a row
of waning moons and closed umbrellas. Unfortunately, greedy copyright trolls are claiming
that waning moons look like an uppercase C and closed umbrellas look like a J, and they have
a copyright on CJ and JC. Therefore, for each time CJ appears in the mural, Cody-Jamal
must pay

Cody-Jamal is unwilling to let them compromise his art, so he will not change anything already painted. He decided, however, that the empty spaces he still has could be filled strategically, to minimize the copyright expenses.
For example, if CJ?CC? represents the current state of the mural,
with C representing a waning moon, J representing a closed umbrella,
and ? representing a space that still needs to be painted with either
a waning moon or a closed umbrella, he could finish the mural as
CJCCCC, CJCCCJ, CJJCCC, or CJJCCJ.
The first and third options would require paying
Given the costs
Input
The first line of the input gives the number of test cases,
Output
For each test case, output one line containing Case #,
where
Example #1
4
2 3 CJ?CC?
4 2 CJCJ
1 3 C?J
2 5 ??J???
Case #1: 5
Case #2: 10
Case #3: 1
Case #4: 0
Example #2
1
2 -5 ??JJ??
Case #1: -8