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;
long long dp[705][705][2];
char s[705];
long long ans = 0;
int main() {
  scanf("%s", s + 1);
  int len = strlen(s + 1);
  for (int k = 1; k <= 9; k++) {
    memset(dp, 0, sizeof(dp));
    for (int i = 0; i <= s[1] - '0'; i++) {
      bool ty2 = (i >= k), ty3 = (i == (s[1] - '0'));
      dp[1][ty2][ty3] += 1;
    }
    for (int i = 1; i <= len; i++) {
      for (int j = 0; j <= len; j++) {
        for (int st = 0; st <= 1; st++) {
          if (!dp[i][j][st]) continue;
          for (int add = 0; add <= (st ? (s[i + 1] - '0') : 9); add++) {
            dp[i + 1][j + (add >= k)][st && (add == (s[i + 1] - '0'))] +=
                dp[i][j][st];
            dp[i + 1][j + (add >= k)][st && (add == (s[i + 1] - '0'))] %= mod;
          }
        }
      }
    }
    long long tmp = 0;
    for (int j = 0; j <= len; j++) {
      ans += (dp[len][j][0] + dp[len][j][1]) % mod * tmp % mod;
      ans %= mod;
      tmp = (tmp * 10) + 1;
      tmp %= mod;
    }
  }
  printf("%lld", ans);
  return 0;
}