Triangle words (3ms execution time)