include <bits/stdc++.h>
using namespace std;
void print_array(int input[],int n)
{
for (int i = 0; i < n; ++i) {
cout << input[i] << " " ;
}
}
void insertion_sort(int input[], int n)
{
for (int i = 1; i <n ; i++) {
for (int j = 0; j <i ; j++) {
if(input[j]>=input[i]){
int temp=input[i];
for (int k = i; k >j ;k--) {
input[k]=input[k-1];
input[j]=temp;
}
}
}
}
print_array(input, n);
}
int main ()
{
int n;
cin >> n;
int input[1000];
for (int i = 0; i <n ; i++) {
cin >> input[i];
}
insertion_sort(input, n);
}