#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << "=" << a << ", ";
  err(++it, args...);
}
long long int po[100007], ser[100007], sum[100007], n;
string s, S;
vector<long long int> v;
void precal() {
  long long int i, j;
  po[0] = 1;
  for (i = 1; i <= 100007 - 5; i++) po[i] = (po[i - 1] * 10) % 1000000007;
  ser[0] = 1;
  for (i = 1; i <= 100007 - 5; i++)
    ser[i] = (ser[i - 1] + ((i + 1) * po[i]) % 1000000007) % 1000000007;
  sum[0] = 0;
  for (i = 1; i <= 100007 - 5; i++) sum[i] = (sum[i - 1] + i) % 1000000007;
}
int main() {
  {
    long long int a = 0, b = 0, c = 0, d, e, f, g, i, j, k, l, m, p, q, r, u, w,
                  t, tc = 1, in, loc, val, sz, lo, hi, mid, mn = 2134567891,
                  mx = 0, sum1 = 0, ans = 0;
    for (t = 1; t <= tc; t++) {
      precal();
      cin >> s;
      n = s.size();
      s = ' ' + s;
      for (i = n; i >= 1; i--) {
        a = s[i] - '0';
        l = i - 1;
        r = n - i;
        ans = ans + a * (sum[l] * po[n - i]) % 1000000007;
        ans = (ans + a * ser[r - 1]) % 1000000007;
      }
      cout << ans << endl;
    }
  }
  return 0;
}
