#include <iostream>
using namespace std;
int main()
{
int a, b, sum=0, e, d=0,f, g, h=0, k ,l;
cin >> a >> b;
for (int i = a; i<=b ; i++){
k=i;
sum=0;
g=i;
e=i;
d=0;
while (k>0){
++d;
k/=10;
}
while (e>0){
f=e%10;
l=f;
for (int j = 1; j<d; j++){
f*=l;
}
sum+=f;
e/=10;
}
if(sum==i){
cout << sum << " ";
h++;
}
}
if(h==0){
cout << "none" << endl;
}
return 0;
} //編寫:西松高不太會函式的菜鳥菜鳥高一生