public class narcissus
{
public static void main(String args[])
{
long u=0,t=0,h=0,y=0,k=0;
for(long x=100; x<1000;x++)
{
u=x%10;
t=x/10%10;
h=x/100%10;
//k=x/1000%10;
//System.out.printf("%d
",x);
y=(u*u*u)+(t*t*t)+(h*h*h);
if(y==x) System.out.printf("%d
",y);
}
}
}