Code for Trie with book search.