program pr1;
var ch:array[1..25] of integer; n,i,k,min,max:byte;
begin
writeln('Vvedi n');
readln(n);
for i:=1 to n do
begin
ch[i]:=random(101)-50;
write(ch[i]:4);
end;
writeln;
max:=1;
min:=1;
for i:=2 to n do
begin
if ch[i]>ch[max] then max:=i;
if ch[i]<ch[min] then min:=i;
end;
writeln(max);
writeln(min);
for i:=1 to n do
if ((i<max)or(i>min)) then begin
inc(k);
ch[k]:=ch[i];
write(ch[k]:4);
end;
writeln;
end.