Command line program to generate all words that an input string can form