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;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
int const N = 700 + 20, C = 10, mod = 1e9 + 7;
int n, cnt[C], ans;
string s;
inline void add(int &a, int b) {
  a += b;
  if (a >= mod) a -= mod;
  if (a < 0) a += mod;
}
int pw[C][N], save[N], comb[N][N];
void pre() {
  for (int i = 0; i < C; i++) {
    pw[i][0] = 1;
    for (int j = 1; j < N; j++) pw[i][j] = 1ll * pw[i][j - 1] * i % mod;
  }
  save[0] = 0;
  for (int i = 1; i < N; i++) save[i] = (10ll * save[i - 1] + 1) % mod;
  for (int i = 0; i < N; i++) {
    comb[i][0] = comb[i][i] = 1;
    for (int j = 1; j < i; j++)
      comb[i][j] = (comb[i - 1][j] + comb[i - 1][j - 1]) % mod;
  }
}
inline int func(int n, int m) {
  int ans = 0;
  int sum = 0;
  for (int d = 9; d; d--) {
    sum += cnt[d];
    for (int x = 0; x <= n; x++) {
      add(ans, 1ll * save[x + sum] * pw[10 - d][x] % mod * pw[d][n - x] % mod *
                   comb[n][x] % mod);
    }
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  pre();
  cin >> s;
  n = (int)s.size();
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < s[i] - '0'; j++) {
      cnt[j]++;
      add(ans, func(n - i - 1, n));
      cnt[j]--;
    }
    cnt[s[i] - '0']++;
  }
  add(ans, func(0, n));
  cout << ans << '\n';
}