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;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
pair<int, int> dp[705];
int n, a[705];
char s[705];
void add(int &x, int y) { (x += y) >= 1000000007 ? x -= 1000000007 : x; }
pair<int, int> dfs(int dig, int d, bool flag) {
  if (!dig) return make_pair(0, 1);
  if (dp[dig].first != -1 && !flag) return dp[dig];
  int end = flag ? a[dig] : 9;
  pair<int, int> tmp;
  tmp.first = 0, tmp.second = 0;
  for (int i = 0; i <= end; i++) {
    pair<int, int> ret = dfs(dig - 1, d, flag && i == a[dig]);
    add(tmp.second, ret.second);
    if (i < d)
      add(tmp.first, ret.first);
    else
      add(tmp.first, (1ll * 10 * ret.first + ret.second) % 1000000007);
  }
  dp[dig] = tmp;
  return tmp;
}
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  reverse(s + 1, s + n + 1);
  for (int i = 1; i <= n; i++) a[i] = s[i] - '0';
  int ans = 0;
  for (int i = 1; i <= 9; i++) {
    memset(dp, -1, sizeof(dp));
    add(ans, dfs(n, i, 1).first);
  }
  cout << ans << endl;
}