#include <stdio.h>

int main() {

    int m = 0;//下限
    int n = 0;//上限
    while (scanf("%d %d", &m, &n) != EOF)
    { 
        int i = 0;//遍历
        int count = 0;//记录水仙花数
        for (i = m; i <= n; i++)
        {
            
            int a = i;//赋值给a,以便不会影响到i的值
            int b = a % 10;//个位
            a /= 10;
            int c = a % 10;//十位
            a /= 10;
            int d = a % 10;//百位
            int e = b*b*b + c*c*c + d*d*d;
            if (e == i)
            {
                printf("%d ", i);
                count++;
            }
        }
        if (count == 0)//水仙花数为0
        {
            printf("no\n");
        }
    }
    return 0;
}