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 long long mod = 1e9 + 7;
const long long N = 7e2 + 5;
long long f[N][N][12][2];
string s;
long long n;
long long dp(long long pos, long long cnt, long long digit, bool ch) {
  if (pos == n) return (cnt == 0);
  long long res = f[pos][cnt][digit][ch];
  if (res >= 0) return res;
  res = 0;
  long long hi = 9;
  if (ch == 1) hi = s[pos] - '0';
  for (long long i = 0; i <= hi; ++i) {
    bool nch = 0;
    if (ch == 1 && i == hi) nch = 1;
    res += dp(pos + 1, cnt - (i >= digit), digit, nch);
    res %= mod;
  }
  return f[pos][cnt][digit][ch] = res;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> s;
  n = s.size();
  memset(f, -1, sizeof f);
  long long ans = 0;
  for (long long i = 0; i < 10; ++i) {
    long long cur = i;
    for (long long cnt = 0; cnt < n; ++cnt) {
      long long res = dp(0, cnt + 1, i, 1) - dp(0, cnt + 1, i + 1, 1);
      res %= mod;
      if (res < 0) res += mod;
      ans += res * cur;
      ans %= mod;
      cur = cur * 10 + i;
      cur %= mod;
    }
  }
  cout << ans;
}