#include<bits/stdc++.h>
using namespace std;
int main(){
int a, b, c, t[55], n = 0;
cin >> a;
for (int i = 0; i < a; i++)
{
cin >> b;
t[i] = b;
}
cin >> c;
for (int i = 0; i < a; i++)
{
if (c < t[i])
break;
n++;
}
for (int i = a - 1; i >= n ; i--)
{
t[i + 1] = t[i];
}
t[n] = c;
for (int i = 0; i <= a; i++)
cout << t[i] << " ";
return 0;
}