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;
const int maxn = 710;
const int D = 710;
char s[maxn];
int a[maxn];
int dp[maxn][maxn * 2][10];
int dfs(int pos, int cnt, int v, int limit) {
  if (!pos) return cnt <= D;
  if (!limit && dp[pos][cnt][v] != -1) return dp[pos][cnt][v];
  int up = limit ? a[pos] : 9;
  int ans = 0;
  for (int i = 0; i <= up; i++) {
    ans += dfs(pos - 1, cnt - (i >= v), v, limit && i == a[pos]);
    ans %= mod;
  }
  if (!limit) dp[pos][cnt][v] = ans;
  return ans;
}
int main() {
  scanf("%s", s + 1);
  int n = strlen(s + 1);
  for (int i = 1; i <= n; i++) a[i] = s[i] - '0';
  reverse(a + 1, a + n + 1);
  memset(dp, -1, sizeof dp);
  int val = 1;
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    int pre = 0;
    for (int j = 9; j >= 0; j--) {
      int k = dfs(n, i + D, j, 1);
      ans = (1LL * ans + 1LL * j * val % mod * (k - pre + mod) % mod) % mod;
      pre = k;
    }
    val = val * 10LL % mod;
  }
  printf("%d\n", ans);
}