s = input() ans = '' if 'C' in s: for c in 'TCP': ans += s.count(c) * c else: ans = ''.join(sorted(s)) print(ans)