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;
vector<long long> v;
const long long mod = 1e9 + 7;
long long dp[801][801][13];
long long pre[1001];
long long dfs(long long x, long long y, long long k, bool limit) {
  if (x == -1) {
    if (y == 0)
      return 1;
    else
      return 0;
  }
  if (!limit && dp[x][y][k] != -1) return dp[x][y][k];
  long long res = 0;
  long long up = limit ? v[x] : 9;
  for (long long i = 0; i <= up; i++) {
    if (i >= k) {
      if (y >= 1) {
        res += dfs(x - 1, y - 1, k, limit && i == up);
        res %= mod;
      } else
        continue;
    } else {
      res += dfs(x - 1, y, k, limit && i == up);
      res %= mod;
    }
  }
  if (!limit) dp[x][y][k] = res;
  return res;
}
void solve(string s) {
  v.clear();
  for (long long i = s.size() - 1; i >= 0; i--) v.push_back(s[i] - '0');
  pre[1] = 1;
  for (long long i = 2; i <= 701; i++) {
    pre[i] = (pre[i - 1] * 10 % mod + 1) % mod;
  }
  long long ans = 0;
  for (long long i = 1; i <= 9; i++)
    for (long long j = 1; j <= v.size(); j++) {
      ans += pre[j] * dfs(v.size() - 1, j, i, 1) % mod;
      ans %= mod;
    }
  cout << ans << endl;
}
int main() {
  memset(dp, -1, sizeof(dp));
  string s;
  cin >> s;
  solve(s);
}