s = str(input()) n = len(s) cnt = 0 cur = 0 for c in s: if c == 'a': cnt += 1 else: cur = max(cur, cnt) cnt = 0 else: cur = max(cur, cnt) print('a'*(cur+1))