string = "a" * 50
while "aaaa" in string or "bbbb" in string:
if "aaaa" in string:
#print(string)
string = string.replace("aaaa","bb",1)
else:
#print(string)
string = string.replace("bbbb","aa",1)
print(string)