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>
const int maxn = 1e5 + 10, mod = 1e9 + 7;
int n, m, k, t, num[710], tot;
using namespace std;
char a[710];
long long dp[710][710][10];
long long dfs(int pos, int need, int dig, int limit, int zero) {
  if (pos < 0) return !need;
  if (limit && zero && dp[pos][need][dig] != -1) return dp[pos][need][dig];
  long long ret = 0;
  for (int i = 0; i <= (limit ? 9 : num[pos]); i++) {
    ret = (ret + dfs(pos - 1, max(0, need - (i >= dig)), dig,
                     limit || i < num[pos], zero || i)) %
          mod;
  }
  return limit && zero ? dp[pos][need][dig] = ret : ret;
}
int main() {
  int i, j;
  memset(dp, -1, sizeof(dp));
  scanf("%s", a);
  tot = strlen(a);
  for (i = 0; i < tot; i++) {
    num[tot - 1 - i] = a[i] - '0';
  }
  long long ret = 0, pw = 1;
  for (i = 1; i <= tot; i++) {
    for (j = 1; j < 10; j++) {
      ret = (ret + pw * dfs(tot - 1, i, j, 0, 0) % mod) % mod;
    }
    pw = pw * 10 % mod;
  }
  printf("%lld\n", ret);
  return 0;
}