import java.util.Scanner;
public class a040 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int start,goal,num,pow,i,j;
int array[] = new int [10];
double total = 0;
boolean judge = false;
while(sc.hasNext()) {
start = sc.nextInt();
goal = sc.nextInt();
for( i = start ; i<= goal ; i++) { //起始跟結束
num=i;
pow=0;
total=0;
while(num>0){ //乘冪將數字分開 可當作利用餘數定理求 個位數,十位數存入陣列 等等 且pow++ 可計算數字有幾位
array[pow++]=num%10;
num/=10;
}
for(j=0;j<pow;j++){ //將陣列裡的數字拿出
total+=Math.pow(array[j],pow);
}
if(total==i){
System.out.print((int)total+" ");
judge=true;
}
}
if(judge==false) //否則印出none
System.out.print("none");
}
}
}