Var x:real;
function y16(x:real):real;
begin
if x<=0 then y16:=x+2;<br> if (x>0) and (x<3) then y16:=-x+2;<br> if x>=3 then y16:=-2;
end;
function y18(x:real):real;
begin
if x<=0 then y18:=-x-3;<br> if (x>0) and (x<5) then y18:=x-3;<br> if x>=5 then y18:=2;
end;
begin
readln(x);
writeln(y16(x));
writeln(y18(x))
end.