#include "bits/stdc++.h"
using namespace std;
int main(){
int n, m;
cin >> n >> m;
int total = 0;
for(int i = n; i <= m; i++){
string strnum = to_string(i);
int sum = 0;
for(int j = 0; j < strnum.length(); j++){
sum += pow((strnum[j]-'0'), strnum.length());
}
if(sum == i){
cout << i << " ";
total++;
}
}
if(total == 0){
cout << "none";
}
}