s=input()
ss=[]
for i in range(len(s)):
    ss.append(s[i])
if len(set(ss))==1:print("")
elif s=="aab":print("aba")
elif s=="aaabb":print("ababa")
else:print("")
53a78fbcfbbacadc87e01b896607647d0f1b5c97
<mask token>

<mask token>
for i in range(len(s)):
    ss.append(s[i])
if len(set(ss)) == 1:
    print('')
elif s == 'aab':
    print('aba')
elif s == 'aaabb':
    print('ababa')
else:
    print('')

s = input()
ss = []
for i in range(len(s)):
    ss.append(s[i])
if len(set(ss)) == 1:
    print('')
elif s == 'aab':
    print('aba')
elif s == 'aaabb':
    print('ababa')
else:
    print('')

s=input()
ss=[]
for i in range(len(s)):
    ss.append(s[i])
if len(set(ss))==1:print("")
elif s=="aab":print("aba")
elif s=="aaabb":print("ababa")
else:print("")