program dokoncisla;
uses crt;
var i,s,n,hh,dh:integer;
begin
  writeln('zadaj dolnu hranicu');
  readln(dh);
  writeln('zadaj hornu hranicu');
  readln(hh);
  for n:=dh to hh do begin
    s:=0;
    for i:=1 to trunc (n/2) do
      if n mod i=0 then s:=s+i;
    if s=n then writeln(n);
  end;
  writeln('Koniec');
  readln;
end.
