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;
template <typename T>
inline void read(T &x) {
  char c = getchar();
  T fh = 0;
  bool f = false;
  while (!isdigit(c)) f |= (c == '-'), c = getchar();
  while (isdigit(c)) fh = (fh << 1) + (fh << 3) + (c ^ 48), c = getchar();
  x = f ? -fh : fh;
  return;
}
const int N = 705;
const int mod = 1e9 + 7;
char s[N];
int as[N], x, len;
long long dp[N][N][2], pw[N];
long long dfs(int pos, int sta, bool lim) {
  if (~dp[pos][sta][lim]) return dp[pos][sta][lim];
  if (pos == len + 1) {
    if (!sta) return dp[pos][sta][lim] = 1;
    return dp[pos][sta][lim] = 0;
  }
  int up = lim ? as[pos] : 9;
  long long nw = 0;
  for (int i = (0); i <= (up); ++i) {
    if (!sta && i >= x) break;
    nw = (nw + dfs(pos + 1, sta - (i >= x), lim && (i == up))) % mod;
  }
  return dp[pos][sta][lim] = nw;
}
long long solve() {
  memset(dp, -1, sizeof(dp));
  long long sum = 0;
  for (int i = (len); i >= (1); --i)
    sum = (sum + dfs(1, i, 1) * pw[i - 1] % mod) % mod;
  return sum;
}
int main() {
  cin >> s + 1;
  len = strlen(s + 1);
  pw[0] = 1;
  for (int i = (1); i <= (len); ++i)
    as[i] = s[i] - '0', pw[i] = pw[i - 1] * 10 % mod;
  for (int i = (1); i <= (len); ++i) pw[i] = (pw[i] + pw[i - 1]) % mod;
  long long as1 = 0;
  for (x = 1; x <= 9; ++x) as1 = (as1 + solve()) % mod;
  printf("%d\n", as1);
  return 0;
}