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 long long mod = 1e9 + 7;
string s;
int a[1005], len;
long long f[705][12][705][2], num[705][705];
long long DFS(int i, int j, int k, int flag) {
  if (k < 0) return 0;
  if (!i) {
    if (!k)
      return 1;
    else
      return 0;
  }
  if (f[i][j][k][flag] != -1) return f[i][j][k][flag];
  int st;
  if (flag)
    st = a[i];
  else
    st = 9;
  long long s = 0;
  for (int now = st; now >= 0; now--) {
    if (now >= j)
      s = (s + DFS(i - 1, j, k - 1, flag && now == a[i])) % mod;
    else
      s = (s + DFS(i - 1, j, k, flag && now == a[i])) % mod;
  }
  f[i][j][k][flag] = s;
  return s;
}
int main() {
  memset(f, -1, sizeof(f));
  cin >> s;
  len = s.length();
  for (int i = 1; i <= len; i++) a[i] = s[len - i] - '0';
  for (int i = 1; i <= 9; i++)
    for (int j = 1; j <= len; j++) DFS(len, i, j, 1);
  for (int i = 1; i <= 9; i++)
    for (int j = 1; j <= len; j++) {
      if (f[len][i][j][0] == -1) f[len][i][j][0] = 0;
      if (f[len][i][j][1] == -1) f[len][i][j][1] = 0;
    }
  for (int i = 1; i <= len; i++)
    for (int j = 1; j <= 9; j++)
      for (int k = i; k <= len; k++)
        num[i][j] = (num[i][j] + f[len][j][k][0] + f[len][j][k][1]) % mod;
  for (int i = 1; i <= len; i++)
    for (int j = 1; j < 9; j++)
      num[i][j] = (num[i][j] - num[i][j + 1] + mod) % mod;
  long long ans = 0, s = 1;
  for (int i = 1; i <= len; i++) {
    for (int j = 1; j <= 9; j++)
      ans = (ans + s * num[i][j] % mod * j % mod) % mod;
    s = s * 10 % mod;
  }
  cout << ans << endl;
  return 0;
}