Lower=100
upper=2000
for num in range(Lower,upper+100):
    order=Len(str(num))
    tem=numwhile temp>0:
        digit=temp%10
        sum+=digit**order
        temp//=10
        if num==sum:
            print(num)
