public class a040 {
public int dod(int i) {
int sum=0;
String str = Integer.toString(i);
for(int j=0;j<str.length();j++) {
int k=Integer.parseInt(String.valueOf(i).substring(j,j+1));
sum=(int) (sum+Math.pow(k,str.length()));
}
return sum;
}
public static void main(String[] args) {
java.util.Scanner scanner=new java.util.Scanner(System.in);
while(scanner.hasNext()) {
int n=scanner.nextInt();
int m=scanner.nextInt();
int count=0;
a040 a=new a040();
for(int i=n;i<m+1;i++) {
if(a.dod(i) ==i) {
System.out.print(i+" ");
count=count+1;
}
}System.out.println();
if(count==0) {
System.out.println("none");
}
}
}
}