Problem1578--Morse code

1578: Morse code

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 1  Solved: 1
[Submit] [Status] [Web Board] [Creator:]

Description

Let's write a program that automatically decodes Morse code.
The Morse code corresponding to each letter is as shown in the table below. For example, if .... . .-.. .-.. --- is input, it is decoded into H, E, L, L, O respectively to become HELLO.





For programming convenience, please use the following text data for codes from A to Z and 0 to 9.

".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..", ".---", "-.-", ".-..", "--", "-.", "---", ".--.", "--.-", ".-.", "...", "-", "..-", "...-", ".--", "-..-", "-.--", "--.." , "-----", ".----", "..---", "...--", "....-", ".....", "-....", "--...", "---..", "----."

Input

The first line contains the test case T. (1 <= T <= 20)
Starting from the next line, Morse code is given on a single line for each test case. Morse code characters are separated by spaces, and words are separated by a slash (/). Other input consists only of the codes in the table above.

Output

For each test case, print the decoded string on a separate line. Print alphabets in uppercase and replace slashes (/) with a single space.

Sample Input Copy

3
.... . .-.. .-.. --- / .-- --- .-. .-.. -..
... --- ...
.---- ..--- ...-- / .- -... -.-.

Sample Output Copy

HELLO WORLD
SOS
123 ABC

Source/Category