num = 1 while num < 1000: a = num // 100 b = (num % 100) // 10 c = num % 10 if a*a*a + b*b*b + c*c*c == num: print(num) num += 1