Java straightforward
\nclass Solution {\n    public String strWithout3a3b(int A, int B) {\n        StringBuilder sb = new StringBuilder();\n        while(A + B > 0) {\n            i
```\nclass Solution {\n    public String strWithout3a3b(int A, int B) {\n        StringBuilder sb = new StringBuilder();\n        while(A + B > 0) {\n            int l = sb.length();\n            if (l > 1 && sb.charAt(l - 2) == sb.charAt(l - 1)) {\n                if (sb.charAt(l - 1) == \'a\') {\n                    sb.append(\'b\');\n                    B--;\n                } else {\n                    sb.append(\'a\');\n                    A--;\n                }\n            } else {\n                if (A > B) {\n                    sb.append(\'a\');\n                    A--;\n                } else {\n                    sb.append(\'b\');\n                    B--;\n                }\n            }\n        }\n        return sb.toString();\n    }\n}\n```
[]