14698 - A boring article   

Description

You are helping your friend who is writing an article. Sometimes, they feel their text is too repetitive because the same words appear again and again. To make it more interesting, your friend gives you a dictionary of synonyms.

Your task is to write a program that automatically replaces words with their synonyms whenever possible. If a word does not appear in the dictionary, it should remain unchanged.

Synonym Dictionary given

synonyms = {
    "big": "large",
    "small": "tiny",
    "fast": "quick",
    "slow": "sluggish",
    "happy": "joyful",
    "sad": "unhappy",
    "angry": "furious",
    "good": "great",
    "bad": "awful",
    "hot": "warm",
    "cold": "chilly",
    "smart": "clever",
    "stupid": "dumb",
    "easy": "simple",
    "hard": "difficult",
    "friend": "buddy",
    "enemy": "foe",
    "child": "kid",
    "dog": "puppy",
    "cat": "kitten"
}

Note

You should output the synonym as given in the dictionary (don't make you own synonym dictionary)

 

Input

  • A single line sentence (string).

  • Words are separated by spaces.

  • The input will not contain punctuation, tabs, or newlines — only words and spaces.

Output

  • A single line string where each word is replaced with its synonym (if found in the dictionary).

  • Case of the output word should follow the dictionary (always lowercase as defined).

  • If the word's synonym isn't found in the dictionary preserve it exactly as the input.

  • If the word is in the dictionary matching will be case-insensitive (e.g., BigBIG, and big all map to large).

  • All spaces between words should be preserved exactly as in the input.

There should be '\n' at the end of the output

Sample Input  Download

Sample Output  Download

Tags




Discuss