Wordchain programming puzzle