public class InsertionSortB extends MiniJava {
    public static int[] readArray(int number) {
        // number = Anzahl zu lesender Elemente
        int[] result = new int[number]; // Feld anlegen
        for (int i = 0; i < number; ++i) {
            result[i] = read();
        }
        return result;
    }

    public static int[] sort(int[] a) {
        int[] b = new int[a.length];
        for (int i = 0; i < a.length; ++i) {
            // begin of insert
            int j = 0;
            while (j < i && a[i] > b[j]) ++j;
            // end of locate
            for (int k = i-1; k >= j; --k)
                b[k+1] = b[k];
            // end of shift
            b[j] = a[i];
            // end of insert
        }
        return b;
    } // end of sort

    public static String arrayToString(int[] a) {
        if (a.length == 0) return "[]";
        String res = "[" + a[0];
        for (int i=1; i<a.length; ++i) {
            res += ", " + a[i];
        }
        res += "]";
        return res;
    }
    
    // Jetzt kommt das Hauptprogramm
    public static void main(String[] args) {
        int n = read();
        int[] a = readArray(n);
        a = sort(a);
        write(arrayToString(a));
    } // end of main()    
}
