Easy Python Solution
\n\t\tans = \'\'\n        while a > 0 or b > 0:\n            if a > b and a > 1 and b > 0:\n                ans += \'aab\'\n                a -= 2\n            
```\n\t\tans = \'\'\n        while a > 0 or b > 0:\n            if a > b and a > 1 and b > 0:\n                ans += \'aab\'\n                a -= 2\n                b -= 1\n            if a < b and b > 1 and a > 0:\n                ans += \'bba\'\n                b -= 2\n                a -= 1\n            if a == b and a > 0 and b > 0:\n                ans+=\'ab\'\n                a -= 1\n                b -= 1\n            if a > 0 and b == 0:\n                ans+=a*\'a\'\n                a = 0\n            if b > 0 and a == 0:\n                ans+=b*\'b\'\n                b = 0\n        return ans\n\n```
[]