Var
A:array[1..10] of integer;
min,max:integer;
R:real;
Begin
For var i:= 1 to 10 do
Begin
A[i]:=random(100)-50;
Write(A[i],' ');
R:=A[i];
End;
R:=R/10;
min:=A[1];
For var i:= 2 to 10 do
if A[i]max:=A[1];
For var i:= 2 to 10 do
if A[i]>max then max:=A[i];
For var i:= 1 to 10 do
if A[i] else if A[i]>R then A[i]:= max;
WriteLn;
For var i:= 1 to 10 do
Write(A[i],' ');
End.