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 MAXN = 700 + 10;
const int MOD = 1e9 + 7;
char num[MAXN];
int n;
inline int mul(int a, int b) { return 1ll * a * b % MOD; }
inline void add(int &a, int b) {
  a += b;
  if (a >= MOD) a -= MOD;
}
inline int sub(int a, int b) {
  a -= b;
  if (a < 0) a += MOD;
  return a;
}
namespace solver1 {
int f[10][MAXN][MAXN][2];
int sum[10][MAXN];
int num[MAXN];
void main() {
  for (int i = 1; i <= n; i++) {
    num[i] = ::num[i] - '0';
  }
  for (int x = 1; x <= 9; x++) {
    f[x][0][0][0] = 1;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j <= n; j++) {
        for (int k = 0; k <= 1; k++) {
          if (f[x][i][j][k]) {
            if (x <= num[i + 1]) {
              add(f[x][i + 1][j][1], mul(x, f[x][i][j][k]));
              add(f[x][i + 1][j + 1][1], mul(num[i + 1] - x, f[x][i][j][k]));
              if (k) {
                add(f[x][i + 1][j + 1][k], mul(10 - num[i + 1], f[x][i][j][k]));
              } else {
                add(f[x][i + 1][j + 1][k], f[x][i][j][k]);
              }
            } else {
              add(f[x][i + 1][j][1], mul(num[i + 1], f[x][i][j][k]));
              if (k) {
                add(f[x][i + 1][j][k], mul(x - num[i + 1], f[x][i][j][k]));
                add(f[x][i + 1][j + 1][k], mul(10 - x, f[x][i][j][k]));
              } else {
                add(f[x][i + 1][j][k], f[x][i][j][k]);
              }
            }
          }
        }
      }
    }
  }
  int ans = 0;
  for (int i = 1; i <= 9; i++) {
    for (int j = n; j >= 1; j--) {
      sum[i][j] = sum[i][j + 1] + f[i][n][j][1] + f[i][n][j][0];
      sum[i][j] %= MOD;
    }
  }
  for (int i = 1, base = 1; i <= n; i++, base = mul(base, 10)) {
    for (int j = 1; j <= 9; j++) {
      add(ans, mul(mul(j, base), sub(sum[j][i], j == 9 ? 0 : sum[j + 1][i])));
    }
  }
  printf("%d", ans);
}
}  // namespace solver1
int main() {
  scanf("%s", num + 1);
  n = strlen(num + 1);
  solver1::main();
}