#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
using V = vector<T>;
const double pi = acos(-1.0);
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
const int dy[] = {1, 0, -1, 0};
const int dx[] = {0, 1, 0, -1};
const int dy2[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int dx2[] = {1, 1, 0, -1, -1, -1, 0, 1};
ll po(ll m) {
  if (m == 1) return 0;
  return m * (m - 1) / 2;
}
int main() {
  string s;
  cin >> s;
  ll n = ((ll)(s).size());
  V<ll> l(n), r(n);
  ll t = 1;
  for (ll i = 0; i < n; i++) {
    l[i] = po(n - i) * t % MOD;
    t = t * 10 % MOD;
  }
  t = 1;
  ll now = 0;
  for (ll i = 0; i < n; i++) {
    r[i] = now;
    now += (i + 1) * t;
    t = 10 * t % MOD;
  }
  reverse((s).begin(), (s).end());
  ll ans = 0;
  for (ll i = 0; i < n; i++) {
    ll d = (r[i] + l[i]) % MOD;
    ans += d * (s[i] - '0') % MOD;
    ans %= MOD;
  }
  cout << ans << '\n';
  return 0;
}
