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;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
const int N = 705;
const int MOD = (int)1e9 + 7;
struct Sum {
  int y, x;
};
void update(int& x, int a) {
  x += a;
  if (x >= MOD) x -= MOD;
}
int n;
char s[N];
Sum dp[N][2];
int main() {
  scanf("%s", s);
  n = strlen(s);
  int ans = 0;
  for (int d = 1; d <= 9; d++) {
    memset(dp, 0, sizeof(dp));
    dp[0][0].x = 0;
    dp[0][0].y = 1;
    for (int i = 0; i <= n - 1; i++) {
      int di = s[i] - '0';
      for (int now = 0; now <= 1; now++) {
        int nl = now;
        for (int dd = now ? 9 : di; dd >= 0; dd--) {
          update(dp[i + 1][nl].y, dp[i][now].y);
          if (dd < d)
            update(dp[i + 1][nl].x, dp[i][now].x);
          else
            update(dp[i + 1][nl].x, (10LL * dp[i][now].x + dp[i][now].y) % MOD);
          nl = 1;
        }
      }
    }
    update(ans, dp[n][0].x);
    update(ans, dp[n][1].x);
  }
  printf("%d\n", ans);
  return 0;
}