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 N = 707, M = 12, MOD = 1000 * 1000 * 1000 + 7;
int sum(int a, int b) {
  a += b;
  if (a < 0)
    a += MOD;
  else if (a >= MOD)
    a -= MOD;
  return a;
}
int mul(int a, int b) { return 1LL * a * b % MOD; }
int n, ans, have[N], ps[N], power[M][N], choose[N][N], pp[N][N][M];
string s;
void pre_pro() {
  for (int i = 0; i < M; i++) {
    power[i][0] = 1;
    for (int j = 1; j < N; j++) power[i][j] = mul(power[i][j - 1], i);
  }
  fill(choose[0], choose[0] + N, 1);
  for (int i = 1; i < N; i++)
    for (int j = 1; j < N; j++)
      choose[i][j] = sum(choose[i - 1][j - 1], choose[i][j - 1]);
  for (int cnt = 0; cnt < N; cnt++)
    for (int rem = 0; rem < N; rem++)
      for (int x = 1; x < M; x++)
        if (cnt == 0)
          pp[cnt][rem][x] = power[10 - x][rem];
        else
          pp[cnt][rem][x] =
              sum(pp[cnt - 1][rem][x],
                  mul(choose[cnt][rem],
                      mul(power[x][cnt], power[10 - x][rem - cnt])));
}
void add(int x, int val) {
  have[x] += val;
  for (int j = x; j < M; j++) ps[j] += val;
}
void solve() {
  for (int x = 1; x < 10; x++)
    for (int dex = ps[x - 1]; dex < n; dex++)
      ans = sum(ans, mul(power[10][n - dex - 1],
                         pp[dex - ps[x - 1]][n - ps[M - 1]][x]));
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  pre_pro();
  cin >> s;
  n = s.length();
  for (char c : s) {
    for (int i = 0; i < c - '0'; i++) {
      add(i, 1);
      solve();
      add(i, -1);
    }
    add(c - '0', 1);
  }
  solve();
  cout << ans;
  return 0;
}