build Trie