Program to solve "Wordy"