S = input() _max = 0 i = 0 while i < len(S): if S[i] != 'a': i += 1 continue else: count = 1 for j in range(i+1,len(S)): if S[j] == 'a': count += 1 else: break if count > _max:_max = count i = j + 1 for _ in range(_max + 1): print('a',end='') print()