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 n, ans, num, a[710], dp[710][710][2][2], md = 1000000007;
char s[1010];
int power(int x, int p) {
  int num = 1;
  while (p) {
    if (p & 1) num = (long long)num * x % md;
    x = (long long)x * x % md;
    p >>= 1;
  }
  return num;
}
int dfs(int pos, int cnt, int x, int vis, int flg) {
  if (!pos) return vis && !cnt;
  if (dp[pos][cnt][vis][flg] != -1) return dp[pos][cnt][vis][flg];
  int mx = flg ? a[pos] : 9, sum = 0;
  for (int i = 0; i <= mx; ++i)
    if (i < num)
      sum = (sum + dfs(pos - 1, cnt, x, vis, flg && i == mx)) % md;
    else if (i > num) {
      if (cnt) sum = (sum + dfs(pos - 1, cnt - 1, x, vis, flg && i == mx)) % md;
    } else if (vis)
      sum = (sum + dfs(pos - 1, cnt, x, 1, flg && i == mx)) % md;
    else {
      if (cnt) sum = (sum + dfs(pos - 1, cnt - 1, x, 0, flg && i == mx)) % md;
      sum = (sum + dfs(pos - 1, cnt, x, 1, flg && i == mx)) % md;
    }
  dp[pos][cnt][vis][flg] = sum;
  return sum;
}
int main() {
  scanf("%s", s);
  n = strlen(s);
  for (int i = 1; i <= n; ++i) a[i] = s[n - i] - '0';
  for (int i = 1; i <= 9; ++i) {
    memset(dp, -1, sizeof(dp));
    num = i;
    for (int j = 0; j < n; ++j)
      ans = (ans + (long long)i * power(10, j) % md * dfs(n, j, i, 0, 1) % md) %
            md;
  }
  printf("%d\n", ans);
  return 0;
}