#Python 3.5.2
n, a, r, i = int(input()), input().split(), input(), 0
while (i=r): i+=1;
a.insert(i, r)
for i in range(n+1): print(a[i], end=' ')
//FPC 2.6.4
var
n, r, i, j: byte;
a: array[1..100] of byte;
begin
readln (n);
for i:=1 to n do read(a[i]);
readln (r);
j:=1;
while (j<=n) and (a[j]>=r) do inc(j);
for i:=1 to j-1 do write (a[i], ' ');
write(r, ' ');
for i:=j to n do write (a[i], ' ');
end.