# import sys # #sys.setrecursionlimit(1000000) # input = sys.stdin.readline def mp():return map(int,input().split()) def lmp():return list(map(int,input().split())) import math import bisect from copy import deepcopy as dc from itertools import accumulate from collections import Counter, defaultdict, deque import itertools def ceil(U,V):return (U+V-1)//V def modf1(N,MOD):return (N-1)%MOD+1 inf = int(1e30) mod = int(1e9+7) def rle(lst): ans = [] cnt = 1 ini = lst[0] for i in range(1, len(lst)): if ini == lst[i]:cnt += 1 else: ans.append((ini, cnt)) cnt = 1 ini = lst[i] ans.append((ini, cnt)) return ans s = list(input()) r = rle(s) cnt = 0 for i,j in r: if i == "a":cnt = max(cnt,j) print("a"*cnt+"a")