//先算一下1000以内的水仙花数

import java.util.ArrayList;
import java.util.Scanner;
public class Main {
    public static boolean just(Integer in){
        int temp = in, cnt = 0;
        while (temp > 0) {
            int m = temp % 10;
            temp = temp / 10;
            cnt += m * m * m;
        }
        if(cnt == in){
            return true;
        }else{
            return false;
        }
    }

    public static void main(String[] args){
        int[] ints = new int[]{153, 370, 371, 407};
        //        for(int i = 100; i < 1000; i++){
        //            if(just(i)){
        //                System.out.println(i);
        //            }
        //        }

        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            int n = scanner.nextInt(), m = scanner.nextInt();
            ArrayList<Integer> arrayList = new ArrayList<>();
            for(int i = 0; i < ints.length; i++){
                if(ints[i] >= n && ints[i] <= m){
                    arrayList.add(ints[i]);
                }
            }
            if(arrayList.size() == 0){
                System.out.println("no");
            }else{
                for(int i = 0; i < arrayList.size() - 1; i++){
                    System.out.print(arrayList.get(i) + " ");
                }
                System.out.println(arrayList.get(arrayList.size() - 1));
            }

        }
    }
}