
Morse code was an early way to send text over electrical signals. Every letter and digit has its own pattern of short and long tones, and a pause marks the boundary before the next character.
Read the table below and decode five-letter messages. Every message is exactly five characters long.
| Character | Code | Character | Code | Character | Code |
|---|---|---|---|---|---|
| A | .- | N | -. | 0 | ----- |
| B | -... | O | --- | 1 | .---- |
| C | -.-. | P | .--. | 2 | ..--- |
| D | -.. | Q | --.- | 3 | ...-- |
| E | . | R | .-. | 4 | ....- |
| F | ..-. | S | ... | 5 | ..... |
| G | --. | T | - | 6 | -.... |
| H | .... | U | ..- | 7 | --... |
| I | .. | V | ...- | 8 | ---.. |
| J | .--- | W | .-- | 9 | ----. |
| K | -.- | X | -..- | ||
| L | .-.. | Y | -.-- | ||
| M | -- | Z | --.. |
The first line contains the number of test cases.
Each test case is a single line with five Morse code characters, separated by spaces. Each code is made of dots (.) and dashes (-).
There are at most 1000 test cases.
For each test case, print one line in the form Case x: MESSAGE. Here x is the case number, counting from 1, and MESSAGE is the decoded message written as five uppercase alphanumeric characters.