#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, m;
int t;
int a[1111];
memset(a, 0, 1111);
cin >> n >> m;
for (int i = 0; i < m; ++i)
{
cin >> t;
++a[t];
}
for (int i = 1; i <= n; ++i)
while (a[i]--)
cout << i << ' ';
return 0;
}
桶排把数组定义成全局变量