#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
long long bpow(long long a, long long b) {
  long long s = 1;
  while (b) {
    if (b & 1) s *= a;
    a *= a;
    b >>= 1;
  }
  return s;
}
long long bmpow(long long a, long long b, long long mod) {
  long long s = 1;
  while (b) {
    if (b & 1) s *= a, s %= mod;
    a *= a;
    a %= mod;
    b >>= 1;
  }
  return s;
}
string s;
long long a[(int)1e6];
int main() {
  cin.tie(0);
  cout.tie(0);
  ios::sync_with_stdio(0);
  ;
  cin >> s;
  int n = s.size();
  long long ans = 0;
  a[0] = 1;
  for (int i = 1; i < 1e6; i++) {
    a[i] = a[i - 1] * 10;
    a[i] %= mod;
  }
  long long run = 0;
  for (int i = 0; i < n - 1; i++) {
    int c = s[i] - '0';
    run += c;
    long long len = n - i - 2;
    long long p = n - i - 1;
    ans = (ans + (p * (run * a[len] % mod)) % mod) % mod;
  }
  for (long long i = n - 1; i > 0; i--) {
    int c = s[i] - '0';
    int p = n - i - 1;
    ans = (ans + ((c * a[p] % mod) * (i * (i + 1) / 2)) % mod) % mod;
  }
  cout << ans << "\n";
  return 0;
}
