#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long power(long long a, long long b) {
  if (b == 0) {
    return 1;
  }
  if (b == 1) {
    return a;
  }
  long long ans = 1;
  while (b > 0) {
    if (b % 2 == 1) {
      ans = (a * ans) % mod;
    }
    a = (a * a) % mod;
    b /= 2;
  }
  return ans;
}
class TaskC {
 public:
  void solve(std::istream& in, std::ostream& out) {
    string s;
    in >> s;
    reverse(s.begin(), s.end());
    long long n = s.size();
    long long ans = 0;
    long long cur = 0;
    for (long long i = 0; i < n; ++i) {
      int a = s[i] - '0';
      long long left = ((n - i) * (n - i - 1) / 2) % mod;
      ans = (ans + (a * power(10, i)) % mod * left % mod) % mod;
      ans = (ans + (a * cur) % mod) % mod;
      cur = (cur + (i + 1) * power(10, i) % mod) % mod;
    }
    out << ans << '\n';
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  TaskC solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}
