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;
char num[705];
int a[705];
int f[10][705][705][2], sum[705][705];
long long dfs(int num, int pos, int cnt, bool limit) {
  if (f[num][pos][cnt][limit] != -1) return f[num][pos][cnt][limit];
  if (!pos) return 0;
  long long tmp = 0;
  int up = limit ? a[pos] : 9;
  for (int i = 0; i <= up; i++) {
    if (i >= num && cnt >= 0)
      tmp = (tmp + dfs(num, pos - 1, cnt - 1, limit & (i == up))) % mod;
    else
      tmp = (tmp + dfs(num, pos - 1, cnt, limit & (i == up))) % mod;
  }
  f[num][pos][cnt][limit] = tmp;
  return tmp;
}
void solve() {
  int len = strlen(num);
  for (int i = 0; i < len; i++) a[len - i] = num[i] - '0';
  for (int x = 1; x < 10; x++) {
    f[x][0][0][1] = f[x][0][0][0] = 1;
    for (int j = 1; j <= len; j++) dfs(x, len, j, 1);
  }
  for (int x = 9; x; x--)
    for (int i = 1; i <= len; i++) {
      for (int j = i; j <= len; j++)
        sum[x][i] = (sum[x][i] + f[x][len][j][1]) % mod;
    }
  long long ans = 0, bit = 1;
  for (int i = 1; i <= len; i++, bit = bit * 10 % mod)
    for (int x = 1; x <= 9; x++) {
      long long tmp = (sum[x][i] - sum[x + 1][i] + mod) % mod;
      ans = (ans + tmp * bit % mod * (long long)x % mod) % mod;
    }
  printf("%lld", ans % mod);
}
int main() {
  memset(f, -1, sizeof(f));
  scanf("%s", num);
  solve();
  return 0;
}