#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);
  long long t = 1;
  while (t--) {
    string s;
    cin >> s;
    long long n = s.length();
    long long arr[1000001] = {};
    long long x = 1;
    long long md[n];
    for (long long i = n - 1; i >= 0; i--) {
      md[i] = x % 1000000007;
      x = md[i] * 10;
    }
    long long z = n - 1;
    long long ans = 0;
    for (long long i = n - 1; i >= 1; i--) {
      x = (z * (z + 1)) / 2;
      x %= 1000000007;
      x = (x * (s[i] - '0')) % 1000000007;
      x = (x * md[i]) % 1000000007;
      z--;
      ans = (ans + x) % 1000000007;
    }
    long long k = 0;
    x = 1;
    for (long long i = n - 1; i >= 0; i--) {
      k = (k + (md[i] * x) % 1000000007) % 1000000007;
      md[i] = k;
      x++;
    }
    for (long long i = 0; i <= n - 2; i++) {
      long long x = ((s[i] - '0') * md[i + 1]) % 1000000007;
      ans = (ans + x) % 1000000007;
    }
    cout << ans << "\n";
  }
  return 0;
}
