program p56;
var X,F: real;
begin
Readln(X);
if X<=7 then F:=-3*X+9
else F:=1/(X-7);
Writeln(F)
end.
program p57;
var X,F: real;
begin
Readln(X);
if X<=7 then F:=3*X-9
else F:=1/(X*X-4);
Writeln(F)
end.
program p58;
var X,F: real;
begin
Readln(X);
if (0<=X) and (X<=3) then F:=X*X
else F:=4;
Writeln(F)
end.
program p59;
var X,F: real;
begin
Readln(X);
F:=X*X+4*X+5;
if X>2 then F:=1/F;
Writeln(F)
end.