include<stdio.h>

int main()
{
//int a = 0;
int n = 10000;
int b = 0;
//int sum = 0;
//scanf("%d", a);
while (n <= 99999 && n >= 10000)
{
int sum = 0; //犯了一个大错误,开始将sum放在外面,结果没清0
for (b = 10; n/ b != 0; b = b * 10)
{
sum += (n / b)*(n%b);
}
if (sum == n)
{
printf("%d ", n);
n++;
}
else
{
n++;
}
}
return 0;
}