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 int maxn = 705, mod = 1e9 + 7;
char s[maxn];
int num[maxn];
long long dp[maxn][11], f[maxn][maxn][10][2];
void add(long long& a, int b) { a = (a + b) % mod; }
long long dfs(int pos, int cnt, int cur, bool lim) {
  if (cnt < 0) return 0;
  if (!pos) return !cnt;
  if (~f[pos][cnt][cur][lim]) return f[pos][cnt][cur][lim];
  int bound = lim ? num[pos] : 9;
  long long ans = 0;
  for (int i = 0; i <= bound; i++)
    add(ans, dfs(pos - 1, cnt - (i >= cur), cur, lim && i == bound));
  return f[pos][cnt][cur][lim] = ans;
}
long long solve() {
  int len = strlen(s);
  for (int i = 1; i <= len; i++) num[i] = s[len - i] - '0';
  memset(f, -1, sizeof(f));
  for (int i = 1; i <= len; i++)
    for (int j = 0; j <= 9; j++) dfs(len, i, j, true);
  for (int j = 0; j <= 9; j++) {
    for (int i = 1; i <= len; i++) {
      long long tmp = 0;
      if (~f[len][i][j][0]) add(tmp, f[len][i][j][0]);
      if (~f[len][i][j][1]) add(tmp, f[len][i][j][1]);
      add(dp[1][j], tmp), add(dp[i + 1][j], mod - tmp);
    }
    for (int i = 1; i <= len; i++) add(dp[i][j], dp[i - 1][j]);
  }
  long long ans = 0, pow10 = 1;
  for (int i = 1; i <= len; i++) {
    for (int j = 1; j <= 9; j++)
      add(ans, (dp[i][j] - dp[i][j + 1] + mod) % mod * pow10 % mod * j % mod);
    pow10 = pow10 * 10 % mod;
  }
  return ans;
}
int main() {
  scanf("%s", s);
  printf("%lld\n", solve());
}