s=gets.chomp.chars t=s.count("T") c=s.count("C") p=s.count("P") if c==0 puts "P"*p+"T"*t else puts "T"*t+"C"*c+"P"*p end