Working trie FST. Of course, the running time is affected adversely.