// Problem: P1271 【深基9.例1】选举学生会
// Contest: Luogu
// URL: https://www.luogu.com.cn/problem/P1271
// Memory Limit: 125 MB
// Time Limit: 1000 ms
// User: Pannnn
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> info(n + 1, 0);
int t;
for (int i = 0; i < m; ++i) {
cin >> t;
++info[t];
}
for (int i = 1; i <= n; ++i) {
for (int j = 0; j < info[i]; ++j) {
cout << i << " ";
}
}
cout << endl;
return 0;
}