program lista_uproszczona_usun_elem_z_p;
type tab=array[1..10]of integer;
lst = record
elementy: tab;
ile: integer
end;
var
i, p: integer;
x: lst;
begin
read(x.ile);
for i := 1 to x.ile do
read(x.elementy[i]);
read(p);
if (p >= 1) and (p <= x.ile) then
begin
for i := p to x.ile-1 do
x.elementy[i] := x.elementy[i+1];
x.ile := x.ile - 1;
end;
for i := 1 to x.ile do
write(x.elementy[i], ' ');
end.
cHJvZ3JhbSBsaXN0YV91cHJvc3pjem9uYV91c3VuX2VsZW1fel9wOwp0eXBlIHRhYj1hcnJheVsxLi4xMF1vZiBpbnRlZ2VyOwogICAgIGxzdCA9IHJlY29yZAogICAgICAgICAgICAgICAgZWxlbWVudHk6IHRhYjsKICAgICAgICAgICAgICAgIGlsZTogaW50ZWdlcgogICAgICAgICAgICAgZW5kOwp2YXIKICAgIGksIHA6IGludGVnZXI7CiAgICB4OiBsc3Q7CiAgICAKYmVnaW4KICAgIHJlYWQoeC5pbGUpOwogICAgZm9yIGkgOj0gMSB0byB4LmlsZSBkbwogICAgICAgIHJlYWQoeC5lbGVtZW50eVtpXSk7CgogICAgcmVhZChwKTsKCiAgICBpZiAocCA+PSAxKSBhbmQgKHAgPD0geC5pbGUpIHRoZW4KICAgIGJlZ2luCiAgICAgICAgZm9yIGkgOj0gcCB0byB4LmlsZS0xIGRvCiAgICAgICAgICAgIHguZWxlbWVudHlbaV0gOj0geC5lbGVtZW50eVtpKzFdOwogICAgICAgIHguaWxlIDo9IHguaWxlIC0gMTsKICAgIGVuZDsKCiAgICBmb3IgaSA6PSAxIHRvIHguaWxlIGRvCiAgICAgICAgd3JpdGUoeC5lbGVtZW50eVtpXSwgJyAnKTsKZW5kLg==