#include <iostream>
#include<cmath>
#include<math.h>
using namespace std;
int main(){
int num[7];
int n,m;
int real,armstrong=0;
cin>>n>>m;
for (int k=n;k<=m;k++){
real=k;
int i=0,sum=0;
while(real!=0){
num[i]=real%10;
real=real/10;
i++;
}
for(int j=0;j<i;j++){
sum=sum+pow(num[j],i);
}
if(sum==k){
cout<<sum<<' ';
armstrong=armstrong+1;
}
}
if(armstrong==0){
cout<<"none";
}
return 0;
}