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;
int n, f[1005][1005][2], pw[1005];
char s[1005];
inline int addmod(int x) { return x >= mod ? x - mod : x; }
inline int submod(int x) { return x < 0 ? x + mod : x; }
int dfs(int dep, int cnt, int lim, int x) {
  if (dep == n + 1) return pw[cnt];
  if (f[dep][cnt][lim] != -1) return f[dep][cnt][lim];
  int ans = 0, mx = (lim == 0 ? s[dep] - '0' : 9);
  for (int i = 0; i <= mx; i++)
    ans = addmod(ans + dfs(dep + 1, cnt + (i >= x), lim || i < mx, x));
  return f[dep][cnt][lim] = ans;
}
int main() {
  pw[1] = 1;
  for (int i = 2; i <= 1000; i++) pw[i] = addmod(10ll * pw[i - 1] % mod + 1);
  scanf("%s", s + 1);
  n = strlen(s + 1);
  int ans = 0;
  for (int i = 1; i <= 9; i++) {
    memset(f, 0xff, sizeof(f));
    ans = addmod(ans + dfs(1, 0, 0, i));
  }
  printf("%d", ans);
  return 0;
}