#include <bits/stdc++.h>
using namespace std;
struct _IO {
  _IO() {
    ios::sync_with_stdio(0);
    cin.tie(0);
  }
} _io;
using ll = long long;
using db = long double;
using pi = pair<ll, ll>;
using mi = map<ll, ll>;
using vi = vector<ll>;
ll ri() {
  ll x;
  cin >> x;
  return x;
}
void prl() { cout << '\n'; }
template <class T, class... U>
void prl(T x, U... y) {
  cout << x << ' ', prl(y...);
}
template <class T, class U>
ostream &operator<<(ostream &out, pair<T, U> p) {
  return out << "(" << p.first << ", " << p.second << ")";
}
template <class T>
ostream &operator<<(ostream &out, vector<T> &v) {
  out << "{";
  for (ll i = (0); i < (v.size()); ++i) {
    if (i) out << ", ";
    out << v[i];
  }
  return out << "}";
}
const ll N = 5e6 + 5, M = 1e9 + 7;
inline ll add(ll a, ll b) { return a + b >= M ? a + b - M : a + b; }
inline ll sub(ll a, ll b) { return a - b < 0 ? a - b + M : a - b; }
inline ll mul(ll a, ll b) { return 1LL * a * b % M; }
ll qpow(ll x, ll n) {
  ll res = 1;
  for (; n; n >>= 1, x = x * x % M)
    if (n & 1) res = res * x % M;
  return res;
}
signed main() {
  string s;
  cin >> s;
  ll n = s.size();
  ll ans = 0, lst = 0, inv9 = qpow(9, M - 2);
  auto get = [&](ll x) -> ll {
    return ((qpow(10, x + 1) - 1) * inv9 % M + M) % M;
  };
  for (ll i = (0); i < (n - 1); ++i) {
    lst = ((lst * 10) + (s[i] - '0')) % M;
    233;
    ans = (ans + lst * get(n - i - 2) % M) % M;
  }
  lst = 0;
  for (ll i = (n - 1); i >= (1); --i) {
    lst = lst + qpow(10, n - i - 1) * (s[i] - '0');
    233;
    lst %= M;
    ans = (ans + lst * (i)) % M;
  }
  cout << ans;
}
