local len = 0
local s = {}
n=io.read("*n")
for i=1,n,1 do
s[i]=io.read("*n")
len=len+1
end
k=io.read("*n")
function num(s, k)
if k == 0 then
return
else
while k > 0 do
local i = 1;
local a = 1;
while i < len do
if s[i] < s[i+1] then
table.remove(s,i)
a=2
break;
end
i=i+1
end
if (a==1) then
table.remove(s,len)
end
k=k-1
end
-- return;
end
for i=1,len,1 do
print(s[i])
end
end
num(s, k)