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

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

            if ( andaze > 0 )
            {
                cout << x <<" ";
            }

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

        }

        if ( x == y )
        {
            if ( andaze == 1 && andaze == 0 )
            {
                cout << x <<" " << y;
                andaze ++;
            }

            if ( andaze != 2 && andaze != 1 )
            {
                cout << x <<" ";
            }
        }

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

            else 
            {
                cout << x <<" " ;
            }
            
            if ( andaze == 1 )
            {
                cout << y <<" " << x <<" ";
                andaze ++;
            }

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


    return 0;
}