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;
long long dp[705][2], sum[705][2];
char str[705];
inline void upd(long long &x, long long y) {
  x += y;
  if (x >= 1000000007) x -= 1000000007;
}
int main() {
  scanf("%s", str);
  int n = strlen(str);
  long long ans = 0;
  for (int d = 1; d <= 9; d++) {
    memset(dp, 0, sizeof(dp));
    memset(sum, 0, sizeof(sum));
    dp[0][0] = 1;
    for (int i = 0; i < n; i++) {
      for (int k = 0; k < 2; k++) {
        for (int x = 0; x < 10; x++) {
          if (!k && x > str[i] - '0') continue;
          upd(dp[i + 1][k | (x < str[i] - '0')], dp[i][k]);
          if (x < d)
            upd(sum[i + 1][k | (x < str[i] - '0')], sum[i][k]);
          else
            upd(sum[i + 1][k | (x < str[i] - '0')],
                (sum[i][k] * 10 + dp[i][k]) % 1000000007);
        }
      }
    }
    upd(ans, sum[n][0]);
    upd(ans, sum[n][1]);
  }
  printf("%lld\n", ans);
  return 0;
}