#include <stdio.h>
void main()
{
int i,j,k,s;
for (i=2;i<=1000;i++)
{
s=1;
for (j=2;j<=i/2;j++)
{
if (i%j==0)
{
s=s+j;
}
}
if (s==i)
{
printf("%-5d its factors are :",i);
for(k=1;k<s;k++)
{
if (i%k==0)
{
printf(" %d",k);
}
}
printf("\n");
}
}
}