Given a string of only English letters with a length of not more than 10000. Please reorder the characters and press "Patestpatest ..." to output in order and ignore other characters. Of course, the number of six characters is not necessarily the same, if a certain character has been output, the remaining characters are still printed in the order of Patest until all characters are output.
Input Format:
Enter a non-empty string of only English letters that is not more than 10000 in length on one line.
output Format:
The sorted string is printed on a single line, as required by the topic. The topic guarantees that the output is not empty.
Input Sample:
Redlespaybestpattopteephpereatitappt
Output Sample:
Patestpatestptetptepepee
Import java.util.ArrayList;
Import java.util.List;
Import Java.util.Scanner;
public class Main {public static void main (string[] args) {Scanner in = new Scanner (system.in);
String string = In.nextline ();
In.close ();
list<character> plist = new arraylist<> ();
List<character> alist = new arraylist<> ();
list<character> tlist = new arraylist<> ();
List<character> elist = new arraylist<> ();
list<character> slist = new arraylist<> ();
list<character> tlist = new arraylist<> (); for (int i = 0; i < string.length (); i++) {switch (String.charat (i)) {case ' P ': Plist.add (String.charat (i))
;
Break
Case ' A ': Alist.add (String.charat (i));
Break
Case ' T ': Tlist.add (String.charat (i));
Break
Case ' E ': Elist.add (String.charat (i));
Break
Case ' s ': Slist.add (String.charat (i));
Break
Case ' t ': Tlist.add (String.charat (i));
Break
} int maxSize = Plist.size ();
if (Alist.size () > maxSize) {maxSize = Alist.size ();
} if (Tlist.size () > maxSize) {maxSize = Tlist.size ();
} if (Elist.size () > maxSize) {maxSize = Elist.size ();
} if (Slist.size () > maxSize) {maxSize = Slist.size ();
} if (Tlist.size () > maxSize) {maxSize = Tlist.size ();
for (int i = 0; i < maxSize i++) {if (I < plist.size ()) {System.out.print (Plist.get (i));
The IF (I < alist.size ()) {System.out.print (Alist.get (i));
The IF (I < tlist.size ()) {System.out.print (Tlist.get (i));
The IF (I < elist.size ()) {System.out.print (Elist.get (i));
The IF (I < slist.size ()) {System.out.print (Slist.get (i));
The IF (I < tlist.size ()) {System.out.print (Tlist.get (i));
}
}
}
}