program ex1;
var
tf,n,m,i,j,k,sum:longint;
a:array[1..7]of longint;
s:string;
begin
while not eof do begin
readln(n,m);
tf:=0;
for i:=n to m do begin str(i,s); sum:=0; for j:=1 to length(s) do begin a[j]:=ord(s[j])-48; for k:=1 to length(s)-1 do a[j]:=a[j]*(ord(s[j])-48); inc(sum,a[j]); end;
if sum=i then begin write(i,' ');
inc(tf);
end;
end;
if tf=0 then write('none');
writeln;
end;
end.