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 const nmax = 700;
int const modulo = 1000000007;
int limit[5 + nmax];
char line[5 + nmax];
long long dp[5 + nmax][10][5 + nmax][2];
long long unu[5 + nmax];
int main() {
  cin >> line;
  int n = strlen(line);
  for (int i = 1; i <= n; i++) {
    limit[i] = line[n - i] - '0';
  }
  for (int cif = 0; cif <= 9; cif++) dp[0][cif][0][true] = 1;
  for (int cif = 0; cif <= 9; cif++) {
    for (int i = 1; i <= n; i++) {
      for (int j = 0; j < cif; j++) {
        if (j == limit[i]) {
          dp[i][cif][0][true] += dp[i - 1][cif][0][true];
          dp[i][cif][0][false] += dp[i - 1][cif][0][false];
        } else {
          dp[i][cif][0][j < limit[i]] +=
              dp[i - 1][cif][0][true] + dp[i - 1][cif][0][false];
        }
      }
      dp[i][cif][0][true] %= modulo;
      dp[i][cif][0][false] %= modulo;
      for (int k = 1; k <= i; k++) {
        for (int j = 0; j < cif; j++) {
          if (j == limit[i]) {
            dp[i][cif][k][true] += dp[i - 1][cif][k][true];
            dp[i][cif][k][false] += dp[i - 1][cif][k][false];
          } else {
            dp[i][cif][k][j < limit[i]] +=
                dp[i - 1][cif][k][true] + dp[i - 1][cif][k][false];
          }
        }
        for (int j = cif; j <= 9; j++) {
          if (j == limit[i]) {
            dp[i][cif][k][true] += dp[i - 1][cif][k - 1][true];
            dp[i][cif][k][false] += dp[i - 1][cif][k - 1][false];
          } else {
            dp[i][cif][k][j < limit[i]] +=
                dp[i - 1][cif][k - 1][true] + dp[i - 1][cif][k - 1][false];
          }
        }
        dp[i][cif][k][true] %= modulo;
        dp[i][cif][k][false] %= modulo;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    unu[i] = (unu[i - 1] * 10 + 1) % modulo;
  }
  long long suma = 0;
  for (int cif = 1; cif <= 9; cif++) {
    for (int maimari = 0; maimari <= n; maimari++) {
      suma += (1LL * unu[maimari] * dp[n][cif][maimari][true]) % modulo;
      if (modulo <= suma) suma -= modulo;
    }
  }
  cout << suma;
  return 0;
}