#include <iostream>
#include <string>
using namespace std;
void quick_sort(int a[],int left,int right)
{
//注意:这里一定要解决一个出口问题,不然程序无法出来
if(left > right)
return;
int i = left;
int j = right;
int temp = a[i];
while(i < j){
//注意,这里一定是先从右边开始查找
while(temp <= a[j] && i < j)
j--;
while(temp >= a[i] && i < j)
i++;
if(i < j){
int tmp = a[i];
a[i] = a[j];
a[j] = tmp;
}
}
//注意:这里基数回归一定是两步
a[left] = a[i];
a[i] = temp;
quick_sort(a,left,i-1);
quick_sort(a,i+1,right);
}
int main()
{
int a[5];
for(int i = 0;i < 5;i++){
cin >> a[i];
}
quick_sort(a,0,4);
for(int i = 0;i < 5;i++){
cout << a[i] << " ";
}
return 0;
}