s = input() ans = '' for c in 'TCP': ans += s.count(c) * c print(ans)