//PascalABC.Net 3.1.0.1200
var
x0, xk, h, e, x, a, s: real;
i: integer;
begin
readln(x0, xk, h, e);
x := x0;
repeat
a := 1 / 2 / 3;
s := a;
i := 0;
repeat
i := i + 1;
a := a * (-1) * x * x / (2 * i + 1) / (2 * i);
s := s + a;
until abs(a) < e;
writeln(s:15:5, ' ', (sin(x) / x):15:5);
x := x + h;
until x >= xk;
end.