S = input() t, c, p = S.count('T'), S.count('C'), S.count('P') if c != 0: ans = 'T'*t + 'C'*c + 'P'*p else: ans = 'P'*p + 'T'*t print(ans)