#include<iostream>
using namespace std;
int main(void)
{
int n, x;
while (cin >> n >> x && (n || x))
{
int *a = new int[n + 1];
for (int i = 0; i < n; i++)
{
cin >> a[i];
}
for (int i = 0; i < n; i++)
{
if (a[i] > x)
{
for (int j = n - 1; j >= i; j--)
{
a[j + 1] = a[j];
}
a[i] = x;
break;
}
}
for (int j = 0; j <= n; j++)
{
if (j > 0) cout << " ";
cout << a[j];
}
cout << endl;
delete[]a;
}
return 0;
}
using namespace std;
int main(void)
{
int n, x;
while (cin >> n >> x && (n || x))
{
int *a = new int[n + 1];
for (int i = 0; i < n; i++)
{
cin >> a[i];
}
for (int i = 0; i < n; i++)
{
if (a[i] > x)
{
for (int j = n - 1; j >= i; j--)
{
a[j + 1] = a[j];
}
a[i] = x;
break;
}
}
for (int j = 0; j <= n; j++)
{
if (j > 0) cout << " ";
cout << a[j];
}
cout << endl;
delete[]a;
}
return 0;
}