for i in range(10000, 100000):
sum = 0
a = 10000
while a!=1:
sum += (i//a) * (i % a)
a //= 10
if sum == i:
print(sum, end=" ")
for i in range(10000, 100000):
sum = 0
a = 10000
while a!=1:
sum += (i//a) * (i % a)
a //= 10
if sum == i:
print(sum, end=" ")