//在插入排序的基础上,查找的过程用二分查找来实现,减少了比较次数,移动记录次数不变
#include <iostream>
#include<vector>using namespace std;
int main()
{
vector<int> data;
int a;
while(cin>>a)
data.push_back(a);
for(unsigned i=1;i<data.size();i++)
{
int temp=data[i];
int beg=0,ends=i-1;
while(beg<=ends)
{
int mid=(ends+beg)/2;
if(data[mid]<temp)
{
beg=mid+1;
}
else
ends=mid-1;
}
for(int j=i-1;j>=beg;j--)
{
data[j+1]=data[j];
}
if(beg!=i-1)
data[beg]=temp;
}
for(auto a:data)
cout<<a<<endl;
return 0;
}