Solved generate parentheses problem.