using System; using System.Text; using System.Collections.Generic; namespace MorseCodeTranslator { class MainClass { public static void Main(string[] args) { var morseCodeDictionary = new Dictionary() { {".-","A"}, {"-...","B"}, {"-.-.","C"}, {"-..","D"}, {".","E"}, {"..-.","F"}, {"--.","G"}, {"....","H"}, {"..","I"}, {".---","J"}, {"-.-","K"}, {".-..","L"}, {"--","M"}, {"-.","N"}, {"---","O"}, {".--.","P"}, {"--.-","Q"}, {".-.","R"}, { "...","S"}, {"-","T"}, {"..-","U"}, {"...-","V"}, {".--","W"}, {"-..-","X"}, {"-.--","Y"}, {"--..","Z"} }; string [] morseCodeArray = Console.ReadLine().Split(); StringBuilder sb = new StringBuilder(); foreach (var code in morseCodeArray) { if (code == "|") { sb.Append(" "); } else if (morseCodeDictionary.ContainsKey(code)) { sb.Append(morseCodeDictionary[code]); } } Console.WriteLine(sb); } } }