Trie working with dictionaries