very simple C++ code
\nstring strWithout3a3b(int A, int B) {\n\tstring s, res = "";\n\tif (A >= B) s = "ab";\n\telse s = "ba";\n\twhile (A || B) {\n\t\tif (A > B) res += "a", --A;\n
```\nstring strWithout3a3b(int A, int B) {\n\tstring s, res = "";\n\tif (A >= B) s = "ab";\n\telse s = "ba";\n\twhile (A || B) {\n\t\tif (A > B) res += "a", --A;\n\t\telse if (B > A) res += "b", --B;\n\t\tif (A && B) res += s, --A, --B;\n\t}\n\treturn res;\n}\n```
[]