ternary search trie