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;
char n[710];
int nn;
long long mod = 1e9 + 7, dp[710][710][10];
long long dfs(int len, int sy, int d, bool kk) {
  if (len == nn) return 1;
  if (!kk && dp[len][sy][d] != -1) return dp[len][sy][d];
  int ma = kk ? n[len] - '0' : 9;
  long long ans = 0;
  for (int i = 0; i <= ma; i++) {
    if (i > d) {
      if (sy) ans = (ans + dfs(len + 1, sy - 1, d, kk && ma == i)) % mod;
    } else
      ans = (ans + dfs(len + 1, sy, d, kk && ma == i)) % mod;
  }
  if (!kk) dp[len][sy][d] = ans;
  return ans;
}
int main() {
  scanf("%s", n);
  nn = strlen(n);
  long long now = 1, ans = 0;
  memset(dp, -1, sizeof(dp));
  for (int i = 0; i < nn; i++) {
    long long pre = 0;
    for (int d = 0; d < 10; d++) {
      long long an = dfs(0, i, d, 1);
      ans = (ans + d * now % mod * (an - pre)) % mod;
      pre = an;
    }
    now = now * 10 % mod;
  }
  return printf("%lld", (ans + mod) % mod), 0;
}