def armstrong(n):
result = 0
while(n > 0):
remainder = n % 10
n = n // 10
result += remainder * remainder * remainder
return result;
# 153 = 1*1*1 + 5*5*5 + 3*3*3 = 153 = armstrong
for i in range(1, 500):
if (i == armstrong(i)):
print(i)
'''
run:
1
153
370
371
407
'''