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;
const int N = 1e5 + 7;
const int mod = 1e9 + 7;
int n;
string st;
template <class T>
void normalize(T &x) {
  ((x %= mod) < 0) && (x += mod);
}
const int L = 700 + 3;
int dp[L][L + L][10];
const int zero = 700;
int solve(int ix, int flag, int ltmd, int v) {
  if (v < 0) return 0;
  if (ix == n) return ltmd > zero;
  int ret = 0;
  if (flag == 0 && ~dp[ix][ltmd][v]) return dp[ix][ltmd][v];
  for (int i = 0; i <= 9; ++i) {
    if (flag && i > st[ix] - '0') continue;
    bool nflag = (flag & (i == st[ix] - '0'));
    ret += solve(ix + 1, nflag, ltmd + (i <= v), v);
    normalize(ret);
  }
  if (flag == 0) dp[ix][ltmd][v] = ret;
  return ret;
}
int count(int ix, int vl) {
  return solve(0, 1, zero - ix, vl) - solve(0, 1, zero - ix, vl - 1) + mod;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> st;
  memset(dp, -1, sizeof dp);
  long long ans = 0;
  n = st.size();
  long long cur = 1ll;
  for (int i = n - 1; ~i; --i) {
    for (int j = 0; j <= 9; ++j) {
      ans += 1ll * j * count(i, j) % mod * cur % mod;
      normalize(ans);
    }
    cur = 10ll * cur % mod;
  }
  cout << ans;
  return 0;
}