generate parenthesis of three type