add template for AC automata and Suffix Array