#include <bits/stdc++.h>
using namespace std;
void FAST() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
const long long md = 1000000007;
const long long inf = 1e18L + 5;
const char nl = '\n';
const int N = 200005;
long long powM(long long x, long long y, long long m) {
  long long ans = 1, r = 1;
  x %= m;
  while (r > 0 && r <= y) {
    if (r & y) {
      ans *= x;
      ans %= m;
    }
    r <<= 1;
    x *= x;
    x %= m;
  }
  return ans;
}
int main() {
  FAST();
  int tt{}, T{};
  tt = 1;
  while (tt--) {
    string str, sa, sb;
    long long n{}, m{}, ans{}, k{}, a{}, b{}, c{}, x{}, y{}, f{}, q{};
    cin >> str;
    n = str.length();
    std::vector<long long> v(n + 2, 1LL), w(n + 2, 0LL);
    w[1] = 1LL;
    v[0] = 1LL;
    for (long long i = 1; i < n + 1; ++i) {
      v[i] = ((v[i - 1] % md) * 10LL) % md;
      w[i + 1] =
          (1LL * w[i] % md + (((i + 1) % md) * 1LL * (v[i] % md)) % md) % md;
    }
    for (long long i = 0; i < n; ++i) {
      x = str[i] - '0';
      a = i + i * (i - 1) / 2;
      a = a % md;
      b = n - i - 1;
      ans = (ans + (((a * 1LL * x) % md) * 1LL * v[b]) % md +
             (x * 1LL * w[b]) % md) %
            md;
      ans = (ans + md) % md;
    }
    cout << ans << nl;
  }
  return 0;
}
