#include using namespace std; vector code = {".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..", ".---", "-.-", ".-..", "--", "-.", "---", ".--.", "--.-", ".-.", "...", "-", "..-", "...-", ".--", "-..-", "-.--", "--..", "-----", ".----", "..---", "...--", "....-", ".....", "-....", "--...", "---..", "----."}; int toChar(string S) { for(int i=0;i<26;i++) if(code[i]==S) return i+'A'; for(int i=26;i<36;i++) if(code[i]==S) return i+'0'-26; return -1; } string toMorse(string S) { string ret=""; for(char x : S) { if(x>='A' && x<='Z') ret += code[x-'A']; else ret += code[x-'0'+26]; } return ret; } void update(string &X, string P) { vector dp(P.size()+1, string(100, 'x')); dp[0] = ""; for(int i=0;i dp[i].size() + 1) { dp[i+j] = dp[i] + (char)c; } } } if(X.size() > dp[P.size()].size()) X = dp[P.size()]; } int main() { string T; getline(cin, T); string S = ""; for(char x : T) if ((x >= 'A' && x <= 'Z') || (x >= '0' && x <= '9')) S += x; string C = toMorse(S); int n = C.size(); string X(100, 'n'); for(int i=0;i