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;
int N;
string S;
signed long long dp[2][701];
signed long long p10[707];
signed long long p11[707];
signed long long mo = 1000000007;
void solve() {
  int i, j, k, l, r, x, y;
  string s;
  cin >> S;
  N = S.size();
  for (auto& c : S) c -= '0';
  p10[0] = 1;
  for (i = 0; i < (705); i++) {
    p10[i + 1] = (p10[i] * 10) % mo;
    p11[i + 1] = (p11[i] * 10 + 1) % mo;
  }
  signed long long ret = 0;
  for (j = 1; j <= 9; j++) {
    memset(dp, 0, sizeof(dp));
    dp[1][0] = 1;
    for (i = 0; i < (N); i++) {
      for (x = i; x >= 0; x--) {
        signed long long dp0 = dp[0][x], dp1 = dp[1][x];
        dp[0][x] = dp[1][x] = 0;
        if (dp1) {
          if (S[i] == j) {
            (dp[1][x + 1] += dp1) %= mo;
            (dp[0][x] += dp1 * j) %= mo;
          } else if (S[i] > j) {
            (dp[1][x] += 10 * dp1) %= mo;
            (dp[0][x] += dp1 * 10 * (S[i] - (j + 1))) %= mo;
            (dp[0][x + 1] += dp1) %= mo;
            (dp[0][x] += dp1 * j) %= mo;
          } else {
            (dp[1][x] += dp1) %= mo;
            (dp[0][x] += dp1 * S[i]) %= mo;
          }
        }
        if (dp0) {
          (dp[0][x] += dp0 * (9 - j) * 10) %= mo;
          (dp[0][x + 1] += dp0) %= mo;
          (dp[0][x] += dp0 * j) %= mo;
        }
      }
    }
    for (x = 0; x < (701); x++) {
      (ret += p11[x] * j % mo * (dp[0][x] + dp[1][x])) %= mo;
    }
  }
  cout << ret << endl;
}
int main(int argc, char** argv) {
  string s;
  int i;
  if (argc == 1) ios::sync_with_stdio(false), cin.tie(0);
  for (i = 0; i < (argc - 1); i++) s += argv[i + 1], s += '\n';
  for (i = 0; i < (s.size()); i++) ungetc(s[s.size() - 1 - i], stdin);
  cout.tie(0);
  solve();
  return 0;
}