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 i64 = long long;
const int P = 1e9 + 7;
void inc(int &x, const int y) {
  x += y;
  if (x >= P) x -= P;
}
int f[10][701][10];
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  std::string str;
  std::cin >> str;
  std::reverse(str.begin(), str.end());
  int n = str.length();
  std::vector<int> a(n);
  for (int i = 0; i < n; ++i) a[i] = str[i] - '0';
  std::vector<int> one(n + 1), ten(n + 1);
  one[0] = 0;
  ten[0] = 1;
  for (int i = 1; i <= n; ++i) {
    one[i] = ((i64)one[i - 1] * 10 + 1) % P;
    ten[i] = (i64)ten[i - 1] * 10 % P;
  }
  for (int d = 1; d <= 9; ++d) {
    for (int j = 0; j <= 9; ++j) f[d][0][j] = int(j >= d);
    for (int i = 1; i < n; ++i) {
      for (int j = 0; j <= 9; ++j) {
        for (int k = 0; k <= 9; ++k) inc(f[d][i][j], f[d][i - 1][k]);
        if (j >= d) f[d][i][j] = ((i64)f[d][i][j] * 10 + ten[i]) % P;
      }
    }
  }
  int ans = 0;
  for (int d = 1; d <= 9; ++d) {
    int sav = ans;
    int last = 0;
    for (int i = n - 1; i >= 0; --i) {
      for (int j = int(i == n - 1); j < a[i]; ++j)
        inc(ans, ((i64)f[d][i][j] * ten[last] + (i64)one[last] * ten[i]) % P);
      last += a[i] >= d;
      if (!i) inc(ans, one[last]);
    }
    for (int i = n - 2; i >= 0; --i)
      for (int j = 1; j <= 9; ++j) inc(ans, f[d][i][j]);
    std::cerr << d << ": " << (ans - sav) << '\n';
  }
  std::cout << ans << '\n';
  return 0;
}