ternary trie