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>
const int md = 1e9 + 7;
const int maxn = 700;
int n;
int nums[maxn + 5];
char s[maxn + 5];
int ans = 0;
int f[maxn + 5][2][maxn + 5][10];
int dfs(int dep, bool up, int cnt, int x) {
  if (cnt < 0) return 0;
  if (!dep) return cnt == 0;
  auto &v = f[dep][up][cnt][x];
  if (~v) return v;
  v = 0;
  int lim = up ? nums[dep] : 9;
  for (int i = 0; i <= lim; ++i) {
    bool nup = up & (i == nums[dep]);
    int ncnt = cnt - (i >= x);
    v = (1ll * v + dfs(dep - 1, nup, ncnt, x)) % md;
  }
  return v;
}
void work(int x) {
  std::memset(f, -1, sizeof f);
  for (int i = 1, timer = 1; i <= n; ++i, timer = (1ll * timer * 10 + 1) % md) {
    int res = dfs(n, 1, i, x);
    ans = (ans + 1ll * res * timer % md) % md;
  }
}
signed main() {
  scanf("%s", s + 1);
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  n = std::strlen(s + 1);
  for (int i = 1; i <= n; ++i) nums[i] = s[n + 1 - i] - '0';
  for (int i = 1; i <= 9; ++i) work(i);
  std::cout << ans << std::endl;
}