#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
template <typename A>
ostream &operator<<(ostream &cout, vector<A> const &v);
template <typename A, typename B>
ostream &operator<<(ostream &cout, pair<A, B> const &p) {
  return cout << "(" << p.f << ", " << p.s << ")";
}
template <typename A>
ostream &operator<<(ostream &cout, vector<A> const &v) {
  cout << "[";
  for (int i = 0; i < v.size(); i++) {
    if (i) cout << ", ";
    cout << v[i];
  }
  return cout << "]";
}
template <typename A, typename B>
istream &operator>>(istream &cin, pair<A, B> &p) {
  cin >> p.first;
  return cin >> p.second;
}
long long int expo(long long int a, long long int b, long long int m = mod) {
  a %= mod;
  long long int res = 1;
  while (b) {
    if (b & 1) res = (res * a) % m;
    a = (a * a) % m;
    b >>= 1;
  }
  return res;
}
long long int gcd(long long int a, long long int b) {
  while (b > 0) {
    long long int r = a % b;
    a = b;
    b = r;
  }
  return a;
}
void printTime(clock_t start, clock_t end) {
  double time_taken = double(end - start) / double(CLOCKS_PER_SEC);
  cout << "Time taken by program is : " << fixed << time_taken
       << setprecision(5);
  cout << " sec " << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  clock_t start, end;
  start = clock();
  int t = 1;
  while (t--) {
    string s;
    cin >> s;
    int n = s.length();
    vector<int> a(n);
    long long int presum[n];
    presum[0] = s[0] - '0';
    for (int i = 0; i < n; i++) {
      a[i] = s[i] - '0';
      if (i > 0) presum[i] = presum[i - 1] + a[i];
      presum[i] %= mod;
    }
    long long int ans = 0;
    long long int base = 1;
    for (long long int i = n - 1, p = 0; i >= 0; i--, p++) {
      long long int s1 = 0;
      if (i > 0) s1 = (presum[i - 1] * (p + 1LL)) % mod;
      long long int leftsubs = (i * (i + 1)) / 2;
      leftsubs %= mod;
      s1 = (s1 + (leftsubs * a[i]) % mod) % mod;
      ans = (ans + (s1 * base) % mod) % mod;
      base = (base * 10) % mod;
    }
    cout << ans << "\n";
  }
  end = clock();
  return 0;
}
