#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
long long inf = 1e18;
long long mx = -1;
long long mn = 1e18;
long long calpow(long long a, long long b, long long md) {
  long long mul = 1;
  while (b > 0) {
    if (b & 1) {
      mul = ((a % md) * (mul % md)) % md;
      b--;
    } else {
      a = ((a % md) * (a % md)) % md;
      b /= 2;
    }
  }
  return mul;
}
void solve() {
  long long i, j, n, t, q, a, b, m, k, ct = 0, sum = 0, flag = 0;
  string s;
  cin >> s;
  if (s.size() == 1)
    cout << 0;
  else {
    n = s.size();
    long long dp[n + 1];
    dp[n] = 0;
    for (i = n - 1; i >= 1; i--) {
      dp[i] =
          ((((n - i) % mod) * calpow(10, n - i - 1, mod)) % mod + dp[i + 1]) %
          mod;
    }
    for (i = 1; i <= n; i++) {
      j = (long long)(s[i - 1] - '0');
      sum =
          (sum + ((((i * (i - 1)) / 2 % mod * (calpow(10, n - i, mod))) % mod +
                   dp[i]) %
                  mod * j) %
                     mod) %
          mod;
    }
    cout << sum;
  }
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  while (t--) {
    solve();
    cout << "\n";
  }
  cerr << clock() * 1000.0 / CLOCKS_PER_SEC << 'm' << 's';
  return 0;
}
