Fully working. Execute 'word_chain.rb'.