#include <iostream>

using namespace std;

int main()
{ 
	int n , x , m;
	cin >> n >> x;
	int arr[n];
	m = n + 1;
	int arr2[m];
	for (int i = 0; i < n; ++i)
	{
		cin >> arr[i];
	}
	int i= 0;
	for (int j = 0; j < m; ++j)
	{
		
		if (x > arr[j] && x < arr[j+1])
		{
			arr2[j] = arr[i];
			arr2[j+1] = x;
			j = j+2;
			i = i +1;	
		}
		arr2[j] = arr[i];
		i++;

	}
	
	for (int i = 0; i < m; ++i)
	{
		cout << arr2[i] << " ";
	}
	return 0;
}