Var
a: array [1..10] of integer;
i, max, s, x: integer;
begin
s:=1;
randomize;
for i := 1 to 10 do
begin
a[i] := random(10) + 1
end;
writeln(a);
max := a[1];
for i := 1 to 10 do
begin
if max < a[i] then begin
max := a[i];
s := i
end;
end;
x := a[1];
a[1] := a[s];
a[s] := x;
writeln(a)
end.