Narcissistic Number
A narcissistic number is an \(n\)-digit decimal number, in which the power \(n\) sum of all digits equals that number.
For example, 153 is a 3-digit narcissistic number, and the power \(3\) sum of all its digits equals itself: \(1^3 + 5^3 + 3^3 = 1 + 125 + 27 = 153\).
Given input number \(A, B\), output in ascending order all narcissistic numbers in that range (\(A \le m \le B\)).
Input Specification
The first line will contain a 2 integers \(A, B\) (\(10 < A,B < 100000\)).
Output Specification
Output a single line all the narcissistic numbers within \([A, B]\) in ascending order, separated by a single white space.
Sample Input
101 999
Sample Output
153 370 371 407
Comments