#include <iostream>
#include <math.h>
using namespace std;
int main()
{
int n,m,p=0;
cin >> n >> m;
for (int i=n; i<=m; i++){
int count=0,x=i;
while (x!=0){
x=x/10;
count++;
}
int y=i,sum=0;
for (int j=1; j<=count; j++){
int z = y%10;
sum += pow(z,count);
y=y/10;
}
if (sum==i){
cout << sum << " ";
p=1;
}
}
if (p==0){
cout << "none" << endl;
}
return 0;
}