#include <iostream>
using namespace std;
int main()
{
    int n , x , y , andaze1 , andaze2 , andaze3;
    cin >> n >> y;
    andaze1 = 0;
    andaze2 = 0;
    andaze3 = 0;

    for ( int i = 0 ; i < n ; i ++ )
    {
        cin >> x;
        if ( x < y )
        {
            if ( andaze1 == 0 )
            {
                cout << x <<" ";
                andaze1 ++;
            }

            if ( andaze1 > 0 && i != 0 )
            {
                cout << x <<" ";
            }

            if ( i == n - 1 )
            {
                cout << y;
            }
        }

        if ( x == y )
        {  
            if ( andaze2 == 0 )
            {
                cout << x <<" " << y <<" ";
                andaze2 ++;
            }

            else
            {
                cout << x <<" ";
            }
        }

        if ( x > y )
        {
            if ( andaze2 == 0 )
            {
                if ( andaze3 == 0 )
                {
                    cout << y <<" " << x <<" ";
                    andaze3 ++;
                }

                else 
                {
                    cout << x <<" ";
                }
            }

            else
            {
                cout << x <<" ";
            }
        }
    }

    return 0;
}