Building a suffix tree with the naive algorithm