Improved common trie exercise.