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 mod = 1e9 + 7;
int add(int x, int y) {
  x += y;
  return x >= mod ? x - mod : x;
}
int sub(int x, int y) {
  x -= y;
  return x < 0 ? x + mod : x;
}
int mul(int x, int y) { return 1LL * x * y % mod; }
string s;
int len;
vector<int> digit;
int pre[710], dp[710][710][2];
int dfs(int pos, int i, bool lim, int j) {
  if (pos == len) return pre[i];
  if (dp[pos][i][lim] != -1) return dp[pos][i][lim];
  int up = lim ? digit[pos] : 9;
  int ans = 0;
  for (int d = 0; d <= up; d++)
    ans = add(ans, dfs(pos + 1, i + (d >= j), lim && (d == digit[pos]), j));
  return dp[pos][i][lim] = ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  pre[1] = 1;
  for (int i = 2; i <= 700; i++) pre[i] = add(mul(pre[i - 1], 10), 1);
  cin >> s;
  len = s.size();
  for (int i = 0; i < len; i++) digit.push_back(s[i] - '0');
  int ans = 0;
  for (int j = 1; j < 10; j++) {
    memset(dp, -1, sizeof(dp));
    ans = add(ans, dfs(0, 0, 1, j));
  }
  cout << ans;
  return 0;
}