#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
long long inf = 1e18;
long long m_inf = INT_MIN;
long long extendedgcd(long long a, long long b, long long &x, long long &y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  long long x1, y1;
  long long d = extendedgcd(b % a, a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
  return d;
}
long long expmod(long long a, long long b) {
  if (b == 1) return a;
  if (b == 0) return 1;
  long long m1 = expmod(a, b / 2) % mod;
  if (b % 2) return ((m1 * m1) % mod * a % mod) % mod;
  return (m1 * m1) % mod;
}
void solve() {
  string str;
  cin >> str;
  long long ans = 0;
  long long n = str.size();
  for (long long i = 0; i < n; i++) {
    long long left = (((i * (i + 1)) / 2) % mod * expmod(10, n - i - 1)) % mod;
    long long right = ((((9 * (n - i - 1) * (expmod(10, n - i - 1)))) % mod -
                        expmod(10, n - i - 1) + 1 + mod) %
                       mod);
    long long x, y;
    long long rem = extendedgcd(81, mod, x, y);
    x = (x % mod + mod) % mod;
    right = (right * x) % mod;
    long long temp = ((left + right) * (str[i] - '0')) % mod;
    ans = (ans + temp) % mod;
  }
  cout << ans << '\n';
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  std::cout.unsetf(std::ios::fixed);
  std::cout.precision(9);
  long long t = 1;
  while (t--) {
    solve();
  }
}
