var
a:string;i,j:integer;check:boolean;beginreadln (a);for i:=1 to length(a) dobeginif (a[i]='7') thenfor j:=1 to length(a) doif (a[j]='9') then check:=true;end;if (check) then writeln (a);writeln;end.
var
a:string;
i,j:integer;
check:boolean;
begin
readln (a);
for i:=1 to length(a) do
begin
if (a[i]='7') then
for j:=1 to length(a) do
if (a[j]='9') then check:=true;
end;
if (check) then writeln (a);
writeln;
end.