//阿姆斯壯數
#include<iostream>
#include<math.h>
using namespace std;
int main(){
int a, b;
while (cin>>a>>b){
int judge = 0; //用來判斷是否印出none
for (int Number = a; Number <= b; Number++) {
int count = 0; //count代表次方
while (Number >= pow(10, count)) {
count += 1;
}
//結束while迴圈時的count就是Number的位數
int sum = 0;
int temp_Number = Number; //Number要用來和sum比較
while (temp_Number > 0) { //不能用Number來做判斷,因為Number的改變會間接造成整個for迴圈的錯誤
sum += pow(float(temp_Number % 10), float(count)); //將sum進行加總
temp_Number /= 10; //一步步將Number縮減
}
if (sum == Number) {
judge = 1; //judge為1代表在使用者輸入的範圍內有出現阿姆斯壯數
cout << sum << " ";
}
}
if (judge == 0)cout << "none" << endl;
else cout << endl;
}
return 0;
}