#include<stdio.h>
int main()
{
int i,j,n,sum=0;
scanf("%d",&n);
for(i=2;i<=n;i++)
{
sum=0;
for(j=1;j<=i/2;j++)
{
if(i%j==0)
sum+=j;
}
if(sum==i)
{
printf("%d its factors are ",i);
for(j=1;j<=i/2;j++)
{
if(i%j==0)
printf("%d",j);
}
putchar('\n');
}
}
return 0;
}