#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  if (s.length() == 1)
    cout << "0\n";
  else {
    long long ans = 0;
    long long t = 1;
    long long sum = 1;
    long long k = 1;
    long long val = 0;
    for (long long i = s.length() - 2; i >= 0; i--) {
      val = (val % 1000000007 + (k * t) % 1000000007) % 1000000007;
      ans = (ans + ((s[i] - '0') * (val)) % 1000000007) % 1000000007;
      k = (k + 1) % 1000000007;
      t = (t * 10) % 1000000007;
    }
    long long d = s.length();
    d--;
    t = 1;
    for (long long i = s.length() - 1; i > 0; i--) {
      long long k =
          (d * (d + 1) / 2 % 1000000007 * t % 1000000007) % 1000000007;
      k = ((s[i] - '0') * k) % 1000000007;
      ans = (ans + k) % 1000000007;
      d = (d - 1) % 1000000007;
      t = (t * 10) % 1000000007;
    }
    cout << ans << endl;
  }
  return 0;
}
