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 = 777;
const int MOD = 1e9 + 7;
char ss[MAXN];
long long dp[MAXN][MAXN][3];
int main() {
  scanf("%s", ss);
  int len = strlen(ss);
  long long ans = 0;
  for (int i = 1; i <= 9; i++) {
    for (int j = 0; j <= len + 11; j++)
      for (int k = 0; k <= j + 11; k++)
        for (int l = 0; l <= 1; l++) dp[j][k][l] = 0;
    dp[0][0][1] = 1;
    for (int j = 0; j < len; j++)
      for (int k = 0; k <= j; k++)
        for (int l = 0; l <= 1; l++)
          for (int m = 0; m <= 9; m++) {
            int keep;
            if (m < ss[j] - '0')
              keep = 0;
            else if (m == ss[j] - '0')
              keep = l;
            else if (l)
              continue;
            else
              keep = 0;
            int kk;
            if (m >= i)
              kk = k + 1;
            else
              kk = k;
            dp[j + 1][kk][keep] = (dp[j + 1][kk][keep] + dp[j][k][l]) % MOD;
          }
    long long base = 1;
    for (int j = 1; j <= len; ++j) {
      ans = (ans + (long long)base * (dp[len][j][0] + dp[len][j][1])) % MOD;
      base = ((base << 1) % MOD + (base << 3) % MOD + 1) % MOD;
    }
  }
  printf("%lld\n", (ans % MOD + MOD) % MOD);
}