#include <bits/stdc++.h>
using namespace std;
int N;
string S;
signed long long dp[2][701];
signed long long p10[707];
signed long long p11[707];
signed long long mo = 1000000007;
void solve() {
  int i, j, k, l, r, x, y;
  string s;
  cin >> S;
  N = S.size();
  for (auto& c : S) c -= '0';
  p10[0] = 1;
  for (i = 0; i < (705); i++) {
    p10[i + 1] = (p10[i] * 10) % mo;
    p11[i + 1] = (p11[i] * 10 + 1) % mo;
  }
  signed long long ret = 0;
  for (j = 1; j <= 9; j++) {
    memset(dp, 0, sizeof(dp));
    dp[1][0] = 1;
    for (i = 0; i < (N); i++) {
      for (x = i; x >= 0; x--) {
        signed long long dp0 = dp[0][x], dp1 = dp[1][x];
        dp[0][x] = dp[1][x] = 0;
        if (dp1) {
          if (S[i] == j) {
            (dp[1][x + 1] += dp1) %= mo;
            (dp[0][x] += dp1 * j) %= mo;
          } else if (S[i] > j) {
            (dp[1][x] += 10 * dp1) %= mo;
            (dp[0][x] += dp1 * 10 * (S[i] - (j + 1))) %= mo;
            (dp[0][x + 1] += dp1) %= mo;
            (dp[0][x] += dp1 * j) %= mo;
          } else {
            (dp[1][x] += dp1) %= mo;
            (dp[0][x] += dp1 * S[i]) %= mo;
          }
        }
        if (dp0) {
          (dp[0][x] += dp0 * (9 - j) * 10) %= mo;
          (dp[0][x + 1] += dp0) %= mo;
          (dp[0][x] += dp0 * j) %= mo;
        }
      }
    }
    for (x = 0; x < (701); x++) {
      (ret += p11[x] * j % mo * (dp[0][x] + dp[1][x])) %= mo;
    }
  }
  cout << ret << endl;
}
int main(int argc, char** argv) {
  string s;
  int i;
  if (argc == 1) ios::sync_with_stdio(false), cin.tie(0);
  for (i = 0; i < (argc - 1); i++) s += argv[i + 1], s += '\n';
  for (i = 0; i < (s.size()); i++) ungetc(s[s.size() - 1 - i], stdin);
  cout.tie(0);
  solve();
  return 0;
}
