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 ll = long long;
using namespace std;
const int N = 1e5 + 10;
const int Mod = 1e9 + 7;
ll dp[710][710][10][2];
ll p[710], a[710];
int n, m, T;
char s[710];
int Read();
ll ans = 0;
ll dfs(int x, int cnt, int now, int lim) {
  if (x > n) return p[cnt];
  if (dp[x][cnt][now][lim] != -1) return dp[x][cnt][now][lim];
  int top = 9;
  ll sum = 0;
  if (lim) top = a[x];
  for (int i = 0; i <= top; i++)
    (sum += dfs(x + 1, cnt + (i >= now), now, lim & (i == top))) %= Mod;
  return dp[x][cnt][now][lim] = sum;
}
int main() {
  for (int i = 1; i <= 700; i++) p[i] = (p[i - 1] * 10ll + 1ll) % Mod;
  cin >> s + 1;
  n = strlen(s + 1);
  for (int i = 1; i <= n; ++i) {
    a[i] = s[i] - '0';
  }
  memset(dp, -1, sizeof dp);
  for (int i = 1; i <= 9; i++) (ans += dfs(1, 0, i, 1)) %= Mod;
  cout << ans << endl;
  return 0;
}
int Read() {
  int val = 0, opt = 1;
  char ch;
  while (!isdigit(ch = getchar()))
    if (ch == '-') opt = -1;
  while (isdigit(ch)) (val *= 10) += ch - '0', ch = getchar();
  return val * opt;
}