#include <stdio.h>
int main()
{
int m,i,s=0;
for(m=1;m<1000;m++)
{
if(m!=1)
{
s=0;
for(i=1;i<m;i++)
if((m%i==0)) s=s+i;
if(s==m)
{
printf("%d its factors are ",m);
for(i=1;i<m;i++)
if(m%i==0) printf("%d ",i);
printf("
");
}
}
else
{
printf("1 its factors are 1");
printf("
");
}
}
return 0;
}