Problems
The story, all names, characters, and incidents portrayed in this problem statement are fictitious. No identification with actual persons is intended or should be inferred.
It is 1935 and a meeting between two Nobel prize winners is producing astonishing results. Schrödinger, a famous physicist, invited Pavlov, a famous physiologist, to see his experiments with cats in boxes. Pavlov brought his dog with him to keep up with his own research, and the combination proved interesting, to say the least.
Schrödinger had a row of
Cats are usually mellow and quiet and do not use the tunnels unless they become startled. When a
third unannounced guest rings the bell, Pavlov's dog gets excited immediately and starts
running and barking. The dog starts at box
After Pavlov's dog finally stops right next to the last box, Pavlov asks Schrödinger whether
there is a cat in that last box. Schrödinger, true to his fame, replies that he does not know.
Pavlov notices that the answer may depend on whether or not there were cats in the unknown boxes.
Moreover, he also notices that because there are
Neither cats, nor dogs, nor Nobel prize winners were harmed in the making of this problem statement.
Input
The first line of the input gives the number of test cases, C' if the box contains a cat, a period '.' if the
box does not contain a cat and a question mark '?' if it is unknown whether
the box contains a cat or not. The third line of a test case contains
Output
For each test case, output one line containing Case #,
where
Example
4
4
??.C
2 3 1 3
4
????
2 3 1 3
6
?.????
6 6 6 6 6 5
34
????????????????????????????????CC
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 33
Case #1: 1
Case #2: 2
Case #3: 15
Case #4: 294967268