#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
long long power[N];
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  t = 1;
  while (t--) {
    string s;
    cin >> s;
    long long n = s.size();
    long long a[n];
    for (int i = 0; i < n; i++) {
      a[i] = s[i] - '0';
    }
    power[0] = 1;
    for (int i = 1; i < N; i++) {
      power[i] = power[i - 1] * 10;
      power[i] %= 1000000007;
    }
    long long curr = 1;
    for (int i = 1; i < n - 1; i++) {
      curr += (power[i] * (i + 1)) % 1000000007;
      curr %= 1000000007;
    }
    long long ans = 0;
    long long lst = n - 1;
    int cp = 1;
    if (n == 1) {
      cout << 0 << endl;
      return 0;
    }
    for (long long i = 0; i < n; i++) {
      ans += (a[i] * curr) % 1000000007;
      long long kk = (lst * power[n - 1 - cp]) % 1000000007;
      curr -= kk;
      curr %= 1000000007;
      cp++;
      curr += 1000000007;
      curr %= 1000000007;
      lst--;
      long long xxx = (((i * (i + 1)) / 2) * a[i]) % 1000000007;
      ans += (xxx * power[n - i - 1]) % 1000000007;
      ans %= 1000000007;
    }
    cout << ans << endl;
  }
}
