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 f[710][2][10][710], ans, len;
char s[710];
long long dfs(int pos, int pre, int now, int t) {
  if (pos > len) return !t;
  if (f[pos][pre][now][t] != -1) return f[pos][pre][now][t];
  long long v = s[pos] - '0', ans = 0;
  for (int i = 0; i < 10; i++) {
    if (!pre && i > v) continue;
    ans =
        (ans + 1ll * dfs(pos + 1, pre | (i < v), now, max(0, t - (i >= now)))) %
        1000000007;
  }
  return f[pos][pre][now][t] = ans;
}
int main() {
  scanf("%s", s + 1), len = strlen(s + 1);
  memset(f, -1, sizeof f);
  for (long long i = 1, now = 1; i <= len; now = (now * 10ll) % 1000000007, i++)
    for (int j = 1; j < 10; j++)
      ans = (ans + 1ll * dfs(1, 0, j, i) * now) % 1000000007;
  printf("%lld\n", ans);
}