#include <stdio.h>
#include <string.h>
#include <math.h>
int main()
{
int Num1 = 0, Num2 = 0, count_none = 0, sum = 0, len = 0, Num_buffer = 0;
char Num_list[10] = {'\0'}; //初始化
scanf("%d %d",&Num1,&Num2);
for(int i = Num1; i <= Num2; i++){
sum = 0;
sprintf(Num_list,"%d",i);
len = strlen(Num_list);
Num_buffer = i;
while(Num_buffer){
sum += pow(Num_buffer % 10,len);
Num_buffer = Num_buffer / 10;
}
if(sum == i){
count_none++;
printf("%d ",i);
}
}
if(count_none == 0){
printf("none");
}
return 0;
}