Short and concise solution
\nclass Solution {\n    public String strWithout3a3b(int A, int B) {\n        StringBuilder sb = new StringBuilder();\n        int a = 0, b = 0;\n        while(
```\nclass Solution {\n    public String strWithout3a3b(int A, int B) {\n        StringBuilder sb = new StringBuilder();\n        int a = 0, b = 0;\n        while(A>0 || B>0){\n            if(b<2 && (B-A>1 || a==2 || A==0)){\n                sb.append(\'b\');\n                B--;b++;\n                a=0;\n            }else{\n                sb.append(\'a\');\n                A--;a++;\n                b=0;\n            }\n        }\n        return sb.toString();\n    }\n}\n```
[]