Var
i, n, j, p, s: longint;
st: string;
b: boolean;
begin
s := 0;
b := false;
readln(n);
for i := 1 to n.ToString.Length do
s := s + strtoint(n.ToString[i]);
for i := 10 to n - 1 do
begin
st := i.ToString;
p := 1;
for j := 1 to st.Length do
p := p * strtoint(st[j]);
if(p = s) then begin b := true;writeln(i); end;
end;
if(b = false) then write('Нет');
end.