#include<iostream>
#include<sstream>
#include<stdio.h>
#include<vector>
using namespace std;
vector<int> v;
void function1() {
int t = v[0];
v[0] = v[1];
v[1] = t;
}
void function2() {
int t = v[0];
for (int i = 1; i < v.size();i++) {
v[i - 1] = v[i];
}
v[v.size() - 1] = t;
}
void sort() {
for (int i = v.size()-1; i >0; i--) {
int t = i;
for (int t = i; t > 0;t--){
if (v[0] > v[1]) {
function1();
}
function2();
}
for (int t = v.size()-i; t > 0; t--)
function2();
}
}
int main() {
int n;
cin >> n;
while (n--) {
int m = 0;
cin >> m;
v.push_back(m);
}
sort();
for (int i = 0; i < v.size(); i++) {
cout << v[i] << " ";
}
system("pause");
}