S = input() count = 0 for i in range(len(S)): if S[i] == 'a': count += 1 for _ in range(count + 1): print('a',end='') print()