Trie impl in python