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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int maxn = 705;
const long long mod = 1e9 + 7;
long long n, dp[maxn][maxn][3];
char s[maxn];
long long ans;
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  for (int k = 1; k <= 9; k++) {
    memset(dp, 0, sizeof(dp));
    for (int i = 0; i <= (s[1] - '0'); i++)
      dp[1][(i >= k)][(i == (s[1] - '0'))]++;
    for (int i = 1; i < n; i++)
      for (int j = 0; j < n; j++)
        for (int c = 0; c <= 1; c++) {
          int tmp = 0;
          if (dp[i][j][c] == 0) continue;
          if (c == 1)
            tmp = s[i + 1] - '0';
          else
            tmp = 9;
          for (int nxt = 0; nxt <= tmp; nxt++)
            dp[i + 1][j + (nxt >= k)][(c == 1) && (nxt == (s[i + 1] - '0'))] =
                (dp[i + 1][j + (nxt >= k)]
                   [(c == 1) && (nxt == (s[i + 1] - '0'))] +
                 dp[i][j][c]) %
                mod;
        }
    long long t = 0;
    for (int j = 0; j <= n; j++) {
      ans += (dp[n][j][0] + dp[n][j][1]) % mod * t % mod;
      t = ((t * 10) + 1) % mod;
    }
  }
  printf("%lld", ans % mod);
  return 0;
}