Problem: Let S(n) denote the number that represents the digits of n in sorted order. For example, S(1) = 1, S(5) = 5, S(50394) = 3459, S(353535) = 333555.

Given a number X, compute <image> modulo 109 + 7.

Input

The first line of input will contain the integer X (1 ≤ X ≤ 10700).

Output

Print a single integer, the answer to the question.

Examples

Input

21


Output

195


Input

345342


Output

390548434

Note

The first few values of S are 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 12. The sum of these values is 195. 

Solution (in PYTHON):

Solution:
n = map(int, raw_input())
mod = 10 ** 9 + 7
l = len(n)
f = [0] * (l + 1)
for i in xrange(l):
    f[i+1] = (f[i] * 10 + 1) % mod
t = [1] * (l + 1)
for i in xrange(l):
    t[i+1] = t[i] * 10 % mod
ans = 0
for i in xrange(1, 10):
    dp = [0] * (l + 1)
    for j in xrange(l):
        dp[j+1] = (dp[j] * i + (10 - i) * (dp[j] * 10 + t[j])) % mod
    c = 0
    for j, k in enumerate(n):
        z = min(i, k)
        o = k - z
        ans += o * (dp[l-1-j] * t[c+1] + f[c+1] * t[l-1-j]) % mod
        ans += z * (dp[l-1-j] * t[c] + f[c] * t[l-1-j]) % mod
        ans %= mod
        c += k >= i
    ans += f[c]
    if ans >= mod:
        ans -= mod
print ans