Balanced parenthesis generation