Final Aho-Corasick algorithm version