#include<iostream>#include<string>#include<cstring>
using namespace std;intmain(int argc,char** argv){int count[6]={0};//分别用来统计 P A T e s t 的数量
string putstr="PATest";
string str;
cin>>str;int len=strlen(str.c_str());for(int i=0;i<len;i++){if(putstr.find(str[i])!=string::npos){if(str[i]=='P')
count[0]+=1;elseif(str[i]=='A')
count[1]+=1;elseif(str[i]=='T')
count[2]+=1;elseif(str[i]=='e')
count[3]+=1;elseif(str[i]=='s')
count[4]+=1;elseif(str[i]=='t')
count[5]+=1;}elsecontinue;}int i,max=0;//max用来记录出现次数最多的字母 for(i=0;i<6;i++){if(count[i]>max)
max=count[i];}for(i=0;i<max*6;i++){if(count[i%6]>0){switch(i%6){case0:cout<<"P";break;case1:cout<<"A";break;case2:cout<<"T";break;case3:cout<<"e";break;case4:cout<<"s";break;case5:cout<<"t";break;}
count[i%6]--;}}return0;}