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, maxn = 710;
long long sum[maxn][2], dp[maxn][2];
string s;
inline void Update(long long &x, long long y) { x = (x + y) % mod; }
void Clear() {
  memset(dp, 0, sizeof(dp));
  memset(sum, 0, sizeof(sum));
  dp[0][0] = 1;
}
int main() {
  cin >> s;
  int len = s.length();
  long long ans = 0;
  for (int l = 1; l <= 9; l++) {
    Clear();
    for (int i = 0; i < len; i++)
      for (int j = 0; j < 2; j++)
        for (int k = 0; k <= 9; k++) {
          if (!j && k > s[i] - '0') continue;
          Update(dp[i + 1][j | k < s[i] - '0'], dp[i][j]);
          if (k < l)
            Update(sum[i + 1][j | k < s[i] - '0'], sum[i][j]);
          else
            Update(sum[i + 1][j | k < s[i] - '0'],
                   (sum[i][j] * 10 + dp[i][j]) % mod);
        }
    Update(ans, sum[len][0]);
    Update(ans, sum[len][1]);
  }
  cout << ans << endl;
  return 0;
}