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 int maxn = 2e5 + 5;
const long long mod = 1e9 + 7;
long long f[705][705][11][2], dp[705][11];
char s[705];
int temp[705];
void upt(long long &a, int b) { a = (a + b) % mod; }
int dfs(int pos, int cnt, int cur, bool limit) {
  if (cnt < 0) return 0;
  if (!pos) return !cnt;
  if (f[pos][cnt][cur][limit] != -1) return f[pos][cnt][cur][limit];
  int up = limit ? temp[pos] : 9;
  long long ans = 0;
  for (int i = 0; i <= up; ++i)
    upt(ans, dfs(pos - 1, cnt - (i >= cur), cur, limit && i == up));
  return f[pos][cnt][cur][limit] = ans;
}
long long solve() {
  int len = strlen(s);
  memset(f, -1, sizeof(f));
  for (int i = 0; i <= 9; ++i)
    for (int j = 1; j <= len; ++j) dfs(len, j, i, 1);
  for (int i = 0; i <= 9; ++i) {
    for (int j = 1; j <= len; ++j) {
      if (f[len][j][i][0] != -1) {
        for (int k = 1; k <= j; ++k) upt(dp[k][i], f[len][j][i][0]);
      }
      if (f[len][j][i][1] != -1) {
        for (int k = 1; k <= j; ++k) upt(dp[k][i], f[len][j][i][1]);
      }
    }
  }
  long long ans = 0, pow10 = 1;
  for (int i = 1; i <= len; i++) {
    for (int j = 1; j <= 9; j++)
      upt(ans, (dp[i][j] - dp[i][j + 1] + mod) % mod * pow10 % mod * j % mod);
    pow10 = pow10 * 10 % mod;
  }
  return ans;
}
int main() {
  scanf("%s", s);
  int len = strlen(s);
  for (int i = 1; i <= len; ++i) temp[i] = s[len - i] - '0';
  printf("%lld\n", solve());
  return 0;
}