#include <bits/stdc++.h>
const int32_t mod = 1000000007;
int32_t main() {
  std::ios::sync_with_stdio(false);
  std::string s;
  std::cin >> s;
  int32_t n = s.size();
  for (int32_t i = 0; i < n; i++) s[i] = s[i] - '0';
  std::vector<int32_t> sum(n);
  sum[0] = s[0];
  int32_t prefix = s[0];
  for (int32_t i = 1; i < n; i++) {
    prefix = (10ll * prefix + s[i]) % mod;
    sum[i] = (sum[i - 1] + prefix) % mod;
  }
  int32_t ans = 0;
  int32_t suffix = 0;
  for (int32_t i = n, offset = 1; i-- > 1;) {
    suffix = (1ll * offset * s[i] + suffix) % mod;
    ans = (ans + 1ll * i * suffix) % mod;
    ans = (ans + 1ll * offset * sum[i - 1]) % mod;
    offset = 10ll * offset % mod;
  }
  std::cout << ans << "\n";
  return 0;
}
