#include<stdio.h>
void main(){
long mul,number,k,a,b;
printf("It exists following automorphic nmbers small than 100000:\n");
for(number=0;number<100000;number++)
{
for(mul=number,k=1;(mul/=10)>0;k*=10);
a=k*10;
mul=0;
b=10;
while(k>0){
mul=(mul+(number%(k*10))*(number%b-number%(b/10)))%a;
k/=10;
b*=10;
}
if(number==mul)
printf("%ld ",number);}
printf("\n");
}