How can I optimize this Python code to generate all words with word-distance 1? How can I optimize this Python code to generate all words with word-distance 1? python python