S = input() t, c, p = S.count('T'), S.count('C'), S.count('P') ans = 'T'*t + 'C'*c + 'P'*p print(ans)