Replace words with different synonyms and print each combination in a text file

Many thanks! I try to understand what you did. Is there also a way to print every possible combination?