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;
long long read() {
  long long rt = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    rt = (rt << 3) + (rt << 1) + ch - '0';
    ch = getchar();
  }
  return rt * f;
}
const int Mod = 1e9 + 7;
const int maxn = 705;
long long dp[maxn][maxn][10][2];
long long sum[maxn];
char s[maxn];
int ss[maxn];
long long dfs(int len, int cnt, int num, bool lim) {
  if (cnt < 0) return 0;
  if (dp[len][cnt][num][lim] != -1) return dp[len][cnt][num][lim];
  if (!len) {
    return (cnt == 0);
  }
  long long rt = 0;
  int up;
  if (lim)
    up = ss[len];
  else
    up = 9;
  for (int i = 0; i <= up; i++) {
    rt += dfs(len - 1, cnt - (i >= num), num, lim & (i == up));
    rt %= Mod;
  }
  return dp[len][cnt][num][lim] = rt;
}
int main() {
  scanf("%s", s + 1);
  int len = strlen(s + 1);
  for (int i = 1; i <= len; i++) {
    ss[i] = s[len - i + 1] - '0';
  }
  sum[1] = 1;
  for (int i = 2; i <= len; i++) sum[i] = sum[i - 1] * 10 + 1, sum[i] %= Mod;
  long long ans = 0;
  memset(dp, -1, sizeof(dp));
  for (int i = 1; i <= len; i++) {
    for (int j = 1; j <= 9; j++) {
      ans += dfs(len, i, j, 1) * sum[i] % Mod;
      ans %= Mod;
    }
  }
  cout << ans << endl;
  return 0;
}