#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];
	}
	for (int i = 0; i < m; ++i)
	{
		arr2[i] = arr[i];
	}
	arr2[m-1] = x;
	for (int i = 0; i < m; ++i)
	{
		int min = arr2[i];
		int index = i;
		for (int j = i + 1; j < m; ++j)
		{
			if (min > arr2[j])
			{
				min = arr2[j];
				index = j;
			}
		}
		swap(arr2[i], arr2[index]);
	}
	
	for (int i = 0; i < m; ++i)
	{
		cout << arr2[i] << " ";
	}
	return 0;
}