S = input() d = {'T': 0, 'C': 1, 'P': 2} ans = sorted(S, key=lambda c: d[c]) print(''.join(ans))