public class test4 {
public static void main(String[] args) {
String str = "91 27 46 38 50";
String[] res = str.split(" ");
int[] ints = new int[res.length];
for (int i = 0; i < res.length; i++) {
ints[i] = Integer.parseInt(res[i]);
}
Arrays.sort(ints);
String st = Arrays.toString(ints);
String s = st.replace("[","").replace("]","").replace(",","");
System.out.println(s);
}
}