{"problem":{"name":"111. Word Subsitution","description":{"content":"In this question you must encrypt or decrypt a message by replacing a key letter with a word or a key word with a letter. If the message contains the key word then you should be decrypting and replaci","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10269111"},"statements":[{"statement_type":"Markdown","content":"In this question you must encrypt or decrypt a message by replacing a key letter with a word or a key word with a letter. If the message contains the key word then you should be decrypting and replacing the key word with the key letter. If the message given does not contain the key word then you should be encrypting and should be replacing the key letter with the key word. The key letter will not be within the key word.\n\nThe first line will be the text you are encrypting or decrypting. The second line will be the key letter and the third line will be the key word.\n\nPrint the encrypted or decrypted text\n\n## Input\n\nThe first line will be the text you are encrypting or decrypting. The second line will be the key letter and the third line will be the key word.\n\n## Output\n\nPrint the encrypted or decrypted text\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ M $ be the input message (string).  \nLet $ c \\in \\Sigma $ be the key letter (single character).  \nLet $ w \\in \\Sigma^* $ be the key word (string), with $ c \\notin w $.  \n\n**Constraints**  \n- $ c $ is a single character.  \n- $ w $ is a non-empty string not containing $ c $.  \n\n**Objective**  \nIf $ w \\subseteq M $ (i.e., $ w $ is a substring of $ M $):  \n  Decrypt: replace every occurrence of $ w $ in $ M $ with $ c $.  \n\nElse:  \n  Encrypt: replace every occurrence of $ c $ in $ M $ with $ w $.  \n\nOutput the resulting string.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10269111","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}