#include<stdio.h>
int main(){
int m,n,i,a,b,c,s;
scanf("%d%d",&m,&n);
for(i=m;i<=n;i++){
a=i/100;b=i/10-a*10;c=i%10;
s=a*a*a+b*b*b+c*c*c;
if(s==i)printf("%d ",i);
}
return 0;