#include <bits/stdc++.h>

using namespace std;

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

    int a[100005];

    for (int i = 0; i < n; i++)
        cin >> a[i];

    int pos = n;
    for (int i = 0; i < n; i++) {
        if (a[i] >= x) {
            pos = i;
            break;
        }
    }

    for (int i = n; i > pos; i--)
        a[i] = a[i - 1];

    a[pos] = x;
    n++;

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

    return 0;
}