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;
char a[705];
int X[705];
int N;
long long DP[705][705][10][2];
int main() {
  scanf("%s", a + 1);
  N = strlen(a + 1);
  for (int i = 1; i <= N; ++i) X[i] = a[i] - '0';
  for (int i = 0; i <= 9; ++i) DP[0][0][i][1] = 1;
  for (int d = 0; d <= 9; ++d) {
    for (int i = 0; i <= N - 1; ++i) {
      for (int j = 0; j <= i; ++j) {
        for (int k = 0; k <= 1; ++k) {
          long long v = DP[i][j][d][k];
          if (!v) continue;
          for (int nd = 0; nd <= 9; ++nd) {
            if (k && nd > X[i + 1]) continue;
            int nk = k && nd == X[i + 1];
            long long& nv = DP[i + 1][j + (nd >= d)][d][nk];
            nv += v;
            if (nv >= MOD) nv -= MOD;
          }
        }
      }
    }
  }
  long long ret = 0;
  for (int d = 1; d <= 9; ++d) {
    long long ones = 1;
    for (int i = 1; i <= N; ++i) {
      long long v = (DP[N][i][d][0] + DP[N][i][d][1]) % MOD;
      ret += v * ones % MOD;
      if (ret >= MOD) ret -= MOD;
      ones = (ones * 10 % MOD + 1) % MOD;
    }
  }
  printf("%lld\n", ret);
}