You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: 984. String Without AAA or BBB.go
    path of file: ./repos/LeetCode-Go/leetcode/0984.String-Without-AAA-or-BBB
    
    the code of the file until where you have to start completion: package leetcode

func strWithout3a3b(A int, B int) string {
	ans, a, b := "", "a", "b"
	if B < A {
		A, B = B, A
    
func strWithout3a3b(A int, B int) string {
	ans, a, b := "", "a", "b"
	if B < A {
		A, B = B, A
		a, b = b, a
	}
	Dif := B - A
	if A == 1 && B == 1 { // ba
		ans = b + a
	} else if A == 1 && B < 5 { // bbabb
		for i := 0; i < B-2; i++ {
			ans = ans + b
		}
		ans = b + b + a + ans
	} else if (B-A)/A >= 1 { //bbabbabb
		for i := 0; i < A; i++ {
			ans = ans + b + b + a
			B = B - 2
		}
		for i := 0; i < B; i++ {
			ans = ans + b
		}
	} else { //bbabbabbabbabababa
		for i := 0; i < Dif; i++ {
			ans = ans + b + b + a
			B -= 2
			A--
		}
		for i := 0; i < B; i++ {
			ans = ans + b + a
		}
	}
	return ans
}