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>
namespace magic_dp {
const int N = 710, MOD = 1000000007;
inline void inc(int a, int &b) { b = (a + b) % MOD; }
char s[N];
int f[N][N][2];
int n, val, ans;
int dp() {
  memset(f, 0, sizeof(f));
  f[0][0][1] = 1;
  for (int i = 0; i < n; i++)
    for (int j = 0; j <= i; j++)
      for (int k = 0; k < 2; k++) {
        int v = f[i][j][k];
        if (!v) continue;
        for (int x = 0; x < 10; x++) {
          inc(v, f[i + 1][j + (x >= val)][k && x == s[i + 1]]);
          if (k && x == s[i + 1]) break;
        }
      }
  static int tmp[N];
  memset(tmp, 0, sizeof(tmp));
  int ret = 0, pow = 1;
  for (int i = 1; i <= n; i++) tmp[i] = (f[n][i][0] + f[n][i][1]) % MOD;
  for (int i = n; i; i--) inc(tmp[i], tmp[i - 1]);
  for (int i = 1; i <= n; i++) {
    inc((long long)pow * tmp[i] % MOD, ret);
    pow = (long long)pow * 10 % MOD;
  }
  return ret;
}
void solve() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  for (int i = 1; i <= n; i++) s[i] -= '0';
  ans = 0;
  for (val = 1; val <= 9; val++) inc(dp(), ans);
  printf("%d\n", ans);
}
}  // namespace magic_dp
int main() {
  magic_dp::solve();
  return 0;
}