https://www.acmicpc.net/problem/10989
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include <cmath>
#include <string.h>
#include <vector>
using namespace std;
int arr[10010] = {0,};
int main() {
int n;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
int a;
scanf("%d", &a);
arr[a]++;
}
for (int i = 1; i < 10010; i++) {
if (arr[i] > 0) {
int cnt = arr[i];
while (cnt >= 1) {
printf("%d\n", i);
cnt--;
}
}
}
return 0;
}