#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long add(long long x, long long y) {
  x += y;
  if (x >= mod) return x - mod;
  return x;
}
long long sub(long long x, long long y) {
  x -= y;
  if (x < 0) return x + mod;
  return x;
}
long long mult(long long x, long long y) { return (x * y) % mod; }
long long power(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1ll) ans = (a * ans) % mod;
    a = (a * a) % mod;
    b >>= 1ll;
  }
  return ans;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  long long ans = 0;
  long long n = s.size();
  long long precompute[n + 1];
  precompute[0] = 1;
  for (long long i = 1; i < n + 1; i++) {
    long long f = mult(i + 1, power(10, i));
    f = add(f, precompute[i - 1]);
    precompute[i] = f;
  }
  for (long long i = 0; i < n; i++) {
    long long sm = power(10, n - i - 1);
    sm = mult(sm, i * (i + 1) / 2);
    sm = mult(sm, s[i] - '0');
    ans = add(ans, sm);
    sm = n - i - 2 >= 0 ? precompute[n - i - 2] : 0;
    sm = mult(sm, s[i] - '0');
    ans = add(ans, sm);
  }
  cout << ans << "\n";
  return 0;
}
