Program NhatNgu;
Uses crt;
Var a,b,i: longint;
Function shh(m: longint): boolean;
Var s,i: longint;
Begin
s:=0;
For i:=1 to m div 2 do
If m mod i = 0 then s:=s+i;
If s=m then exit(true);
exit(false);
End;
Begin
Clrscr;
Write('Nhap a: '); Readln(a);
Write('Nhap b: '); Readln(b);
For i:=a to b do
If shh(i) then Write(i,' ');
Readln
End.