AC Trie, KM algorithm added