#include <iostream>
using namespace std;
int a1[1000];
int b[1000];
int acc = 0;
void erfen(int a[],int l,int r)
{
if(l==r) return ;
int mid=(l+r)/2;
erfen(a,l,mid);
erfen(a,mid+1,r);
int ll=l;
int llr=mid+1;
for(int i=l;i<=r;i++)
{
if((llr>r)||(ll<=mid&&a[ll]<=a[llr]))
b[i]=a[ll++];
//求逆序对的时候a[ll]<a[llr]
//1366 || 1233
//1 2 (和3 6 6都构成逆序对,如果两个数相等的时候,应该先把左区间的数字放下来)
else
b[i]=a[llr++];
//cnt+=mid-ll+1;逆序对总数
}
for(int i=l;i<=r;i++)
{
a[i]=b[i];
}
}
int main() {
for (int i = 0; i < 5; i++) {
cin >> a1[i];
}
erfen(a1,0, 4);
for (int i = 0; i < 5; i++) {
cout << a1[i] << " ";
}
return 0;
}