type array100 = array [1..100] of integer;
var x,y:array100;
i,n,min,max:integer;
Begin
randomize;
n:=10;
for i:= 1 to n do begin
x[i]:=random(n*10)- 10*n div 2 ;
write(x[i]:4);
if i mod 10=0 then writeln;
end;
min:=1;
max:=1;
for i:= 1 to n do begin
if x[i] if x[i]>x[max] then max:=i;
end;
i:=x[min];
x[min]:=x[max];
x[max]:=i;
writeln;
for i:= 1 to n do begin
write(x[i]:4);
if i mod 10=0 then writeln;
end;
End.