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 mod = 1e9 + 7;
int a[708];
long long sum[708];
long long dp[708][708][10][2];
void add(long long &x, long long y) {
  x += y;
  if (x >= mod) x -= mod;
}
long long dfs(int pos, int num, int digit, int limit) {
  if (num < 0) return 0;
  if (pos == 0) return (num == 0);
  if (dp[pos][num][digit][limit] != -1) return dp[pos][num][digit][limit];
  long long ans = 0;
  int top = limit ? a[pos] : 9;
  for (int i = 0; i <= top; i++) {
    add(ans, dfs(pos - 1, num - (i >= digit), digit, limit & (i == top)));
  }
  return dp[pos][num][digit][limit] = ans;
}
int main() {
  string s;
  cin >> s;
  int len = s.size();
  long long cnt = 0;
  for (int i = 0; s[i]; i++) {
    a[len - i] = s[i] - '0';
  }
  memset(dp, -1, sizeof(dp));
  for (int i = 1; i <= 700; i++) {
    sum[i] = (sum[i - 1] * 10 + 1) % mod;
  }
  for (int i = 1; i <= 9; i++) {
    for (int j = 1; j <= len; j++) {
      add(cnt, dfs(len, j, i, 1) * sum[j] % mod);
    }
  }
  printf("%lld\n", cnt);
}