package day1;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.StreamTokenizer;
import java.util.Arrays;
public class Main{
public static void main(String[] args) throws IOException {
StreamTokenizer st=new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
PrintWriter out=new PrintWriter(new OutputStreamWriter(System.out));
st.nextToken();
int m=new Double(st.nval).intValue();
st.nextToken();
int n=new Double(st.nval).intValue();
int[] num=new int[1005];
for(int i=0;i<n;i++)
{
st.nextToken();
num[(new Double(st.nval).intValue())]++;
}
for(int i=1;i<=m;i++)
{
while(num[i]>0)
{
out.print(i+" ");
out.flush();
num[i]--;
}
}
}
}