Procedure
Vstavka;
Var Z, Y, i, j: Integer;
Begin
For i := 2 to n do
For j := 1 to i-1 do
If X[j] > X[i] then
begin
Z := X[i];
For Y := i downto j+1 do X[Y] := X[Y-1];
X[j] := Z
end
End;