Let be the sum of the digits of a non-negative integer . For example, s(123) = 1 + 2 + 3 = 6.
Define the following function:
Find the value of the following sum:
where is a given number.
Two positive integers n~(2 \le n \le 10^7) and m~(m \le 10^9).
Print the value of the desired sum.
For n = 5 the answer is S = 2^2 + 3^3 + 4^4 + 5^5 = 3412. Note that the number is composite, and the sum of its digits is s(4) = 4.
Example 1