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;
inline long long read() {
  long long res = 0;
  char c;
  bool zf = 0;
  while (((c = getchar()) < '0' || c > '9') && c != '-')
    ;
  if (c == '-')
    zf = 1;
  else
    res = c - '0';
  while ((c = getchar()) >= '0' && c <= '9')
    res = (res << 3) + (res << 1) + c - '0';
  if (zf) return -res;
  return res;
}
long long data[701];
long long dp[701][701][10][2];
inline void add(long long &x, long long y) {
  x += y;
  if (x > 1000000007) x -= 1000000007;
  return;
}
signed main() {
  string s;
  cin >> s;
  s = ' ' + s;
  long long n = s.size() - 1;
  for (register long long i = 1; i <= n; i++) {
    data[i] = s[i] - '0';
  }
  for (register long long i = 1; i <= 9; i++) {
    dp[0][0][i][1] = 1;
  }
  for (register long long i = 0; i < n; i++)
    for (register long long j = 0; j <= i; j++)
      for (register long long k = 1; k <= 9; k++)
        for (register long long l = 0; l <= 1; l++)
          for (register long long m = 0; m <= (l ? data[i + 1] : 9); m++)
            add(dp[i + 1][j + (m >= k)][k][l & (m == data[i + 1])],
                dp[i][j][k][l]);
  long long ans = 0;
  for (register long long i = 1; i <= 9; i++) {
    long long tmp = 1;
    for (register long long j = 1; j <= n; j++) {
      add(ans, 1ll * tmp * (dp[n][j][i][0] + dp[n][j][i][1]) % 1000000007);
      tmp = (tmp * 10 + 1) % 1000000007;
    }
  }
  cout << ans << '\n';
  return 0;
}