#include<algorithm>#include<iostream>#include<cstring>
using namespace std;char str[10001];int hashT[6];char a[6]={'P','A','T','e','s','t'};intmain(){fill(hashT,hashT+6,0);scanf("%s",str);int len =strlen(str);int sum =0;for(int i=0;i<len;i++){switch(str[i]){case'P':hashT[0]++;sum++;break;case'A':hashT[1]++;sum++;break;case'T':hashT[2]++;sum++;break;case'e':hashT[3]++;sum++;break;case's':hashT[4]++;sum++;break;case't':hashT[5]++;sum++;break;}}while(sum>0){for(int i=0;i<6;i++){if(hashT[i]!=0){printf("%c",a[i]);
hashT[i]--;
sum--;}}}return0;}