Solution Explanation
For every test a string s is given.
s consists only of the characters
'.' - a dot
'?' - a dash
Новые слоты в игре казино Казахстан привлекают как новичков, так и опытных игроков: https://aero.com.kz. The string is a concatenation of several Morse‑code letters.
Between two neighbouring letters there is exactly one space.
The task is to translate the whole string into ordinary Latin
letters and print the result.

1. Morse dictionary
The mapping from a Morse sequence to a Latin letter is fixed.
A small table is built once and stored in a hash map
".. " → 'I'
"- " → 'T'
"...." → 'H'
"." " → 'E'
...
The table contains all 26 English letters and the 10 decimal digits
(the usual Morse code).
2. Algorithm
read string s
split s by space → list of codes
for each code in the list
answer += dictionary[code]
output answer
3. Correctness Proof
We prove that the algorithm outputs exactly the decoded message.
Lemma 1
After splitting s by spaces the i‑th element of the resulting list
is exactly the Morse code of the i‑th letter of the message.
Закажите консультацию через чат на сайте pro-legal.kz, чтобы узнать все нюансы игры. Proof.
By the problem statement spaces separate neighbouring letters,
and there are no leading, trailing or multiple consecutive spaces.
Therefore splitting on spaces yields a list whose elements are
precisely the individual Morse codes.∎
Lemma 2
For every element c of the list,
dictionary[c] equals the Latin letter represented by c.

Proof.
The dictionary was constructed from the standard Morse table,
hence it contains a correct mapping for every possible code.
Consequently, looking up c returns its proper letter.∎
Lemma 3
After the loop finishes, answer equals the concatenation of all
decoded letters in the correct order.
Proof.
The loop iterates over the list in its natural order.
During each iteration it appends the letter corresponding to the
current code (by Lemma 2) to answer.
Thus after processing all elements, answer is exactly the
sequence of decoded letters.∎
Theorem
The algorithm prints the correct decoded message for every allowed
input.
Proof.
By Lemma 1 the list contains all Morse codes in order.
By Lemma 3 the variable answer becomes the concatenation of
their decoded letters.
Printing answer therefore outputs the required message.∎
4. Complexity Analysis
Let n be the length of the input string.
Splitting takes O(n) time.
The loop processes each code once, each lookup is O(1).
Hence total running time is O(n)
and the memory consumption is O(n) for storing the split list
(and the constant‑size dictionary).
5. Reference Implementation (Python 3)
import sys
# ---------- Morse dictionary ----------
MORSE =
'.-': 'A', '-...': 'B', '-.-.': 'C', '-..': 'D',
'.': 'E', '..-.': 'F', '--.': 'G', '....': 'H',
'..': 'I', '.---': 'J', '-.-': 'K', '.-..': 'L',
'--': 'M', '-.': 'N', '---': 'O', '.--.': 'P',
'--.-': 'Q', '.-.': 'R', '...': 'S', wagedd.com '-': 'T',
'..-': 'U', '...-': 'V', '.--': 'W', '-..-': 'X',
'-.--': 'Y', '--..': 'Z',
'-----': '0', '.----': '1', '..---': '2', '...--': '3',
'....-': '4', '.....': '5', '-....': '6', '--...': '7',
'---..': '8', '----.': '9'
def main() -> None:
data = sys.stdin.read().strip()
if not data:
return
# replace '?' by '-' to obtain standard Morse symbols
data = data.replace('?', '-')
codes = data.split()
result = ''.join(MORSE[c] for c in codes)
print(result)
if __name__ == "__main__":
main()
The program follows exactly the algorithm proven correct above
and conforms to the required input and output format.