Let m be a fixed integer such that m≥2. For a positive integer n, let b_m(n) denote the number of ways of writing n as a sum of powers of m using non-negative exponents with repetitions allowed and the order of the summands not being taken into account. We also set b_m(0)=1 (there is one empty sum).
For example, the first 10 terms of b_2(n) are 1,1,2,2,4,4,6,6,10,10, and the first 10 terms of b_3(n) are 1,1,1,2,2,2,3,3,3,5.
Let c_mk(n) be the k-th convolution power of b_m(n), which is defined as follows: c_mk(n)={b_m(n), ∑_i=0nb_m(i)⋅c_mk−1(n−i),k=1k≥2
Given n, m and k, Bobo would like to find the value of f(n)=(∑_i=0nck_m(i))mod(109+7).
The first line contains three integers n, m and k (0≤n≤1018, 2≤m≤1018, 1≤k≤10).
Output an integer denoting the value of f(n).