#include<iostream>
#include<vector>
#include "sorting.h"
using namespace std;
int main(){
int n;
cin>>n;
vector<int>a;
for(int i=0;i<n;i++){
int x;cin>>x;
a.push_back(x);
}
vector<int> b=sort_custom(a);
for(vector<int>::iterator it=b.begin() ; it!=b.end() ; ++it){
cout<< *it<<" ";
}
cout<<endl;
}

