Program NewtonRaphsonIter(output);
function newton_raphson_iter(a: real; p: real; eps: real; max_i: integer) : real;
var
x: real;
i: integer;
begin
x := a / 2.0;
i := 0;
repeat
x := (x + a / x) / 2.0;
i := i + 1;
if (x * x = a) then break;
if (i >= max_i) then break;
until abs(x - a / x) <= eps;
newton_raphson_iter := x;
end;
var
sqroot: real;
begin
sqroot := newton_raphson_iter(9, 0.001, 0.0000001, 10);
writeln(sqroot);
end.