for i in range(10000,100000):
    if i == (i//10000)*(i%10000)+(i//1000)*(i%1000)+(i//100)*(i%100)+(i//10)*(i%10):
        print(i,end=' ')