program najdiarmstcislo;
uses Crt;
var a,za,s,pc : integer;
begin
  clrscr;
  za:=100;
  for za:=100 to 999 do begin
    s:=0;
    a:=za;
    while a<>0 do begin
      pc:=a mod 10;
      s:=s+pc*pc*pc;
      a:=a div 10;
    end;
    if za=s then writeln(za);
  end;
  readln;
end.
