#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void Quicksort(int* s, int left, int right);
int Partition(int* s, int left, int right);
void Swqp(int idx1, int idx2);
int main() {
int n;
scanf("%d", &n);
int* s;
s = (int*)malloc(n * sizeof(int));
for (int i = 0; i < n; i++) {
scanf("%d", &s[i]);
}
Quicksort(s, 0, n - 1);
for (int i = 0; i < n; i++) {
printf("%d\n", s[i]);
}
//printf("%d", s[n-1]);
}
void Swqp(int* s, int idx1, int idx2) {
int temp = s[idx1];
s[idx1] = s[idx2];
s[idx2] = temp;
}
int Partition(int* s, int left, int right) {
int pivot = s[left];
int low = left + 1;
int high = right;
while (low <= high) {
while (pivot > s[low])
low++;
while (pivot < s[high])
high--;
if (low <= high) {
Swqp(s, low, high);
}
}
Swqp(s, left, high);
return high;
}
void Quicksort(int* s, int left, int right) {
if (left <= right) {
int pivot = Partition(s, left, right);
Quicksort(s, left, pivot - 1);
Quicksort(s, pivot + 1, right);
}
}