/**
* 水仙花数
*/
import java.util.*;
public class acm2010{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
while(in.hasNextInt()){
int firstNum = in.nextInt();
int lastNum
= in.nextInt();
String result= "";
for(int i = firstNum ; i <= lastNum ; i++){
int t1,t2,t3;
t3=i/100;
t2=(i-t3*100)/10;
t1=(i-t3*100 - t2*10);