#include <iostream>
#include <vector>
using namespace std;

int main()
{
    int n, m;
    cin >> n >> m;

    vector<int> arr;

    for (int i = 0; i < n; i++)
    {
        int x;
        cin >> x;
        arr.push_back(x);
        if (i == n - 1)
            arr.push_back(m);
    }

    for (int i = n; i > 0; i--)
    {
        if (arr[i] < arr[i - 1])
            swap(arr[i], arr[i - 1]);
    }

    for (int i = 0; i <= n; i++)
        cout << arr[i] << " ";

    return 0;
}