for i in range(100,1000): temp = i sum = 0 while temp: sum +=(temp%10) ** 3 temp //=10 if sum == i: print(i)