package test;
import java.util.Scanner;
public class pratice {
private static Scanner in;
public static void main(String[] args) {
in = new Scanner(System.in);
int number = 0, start = 0, end = 0;
while (in.hasNext()) {
number = 0;
start = in.nextInt();
end = in.nextInt();
for (int i = start; i <= end; i++) {
if (compute(i) == true) {
System.out.print(i + " ");
} else {
number++;
}
}
if (number == end - start + 1) {
System.out.print("none");
}
System.out.println();
}
}
static public boolean compute(int num) {
String temp = null;
temp = String.valueOf(num);
int number = 0;
for (int i = 0; i < temp.length(); i++) {
number += (int) Math.pow((Integer.valueOf(temp.charAt(i)) - '0'), temp.length());
}
if (num == number) {
return true;
} else {
return false;
}
}
}