#include <bits/stdc++.h>
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c* x) -> decltype(cout << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug& operator<<(const c&) {
    return *this;
  }
};
const long long sz = 1e5 + 5;
const long long mod = 1e9 + 7;
const long double PI = acos(-1);
const long double eps = 1e-10;
const long long INF = 1e18 + 5;
long long power(long long n, long long k, long long m) {
  long long ans = 1;
  while (k) {
    if (k & 1) {
      ans = (ans * n) % m;
      k--;
    } else {
      n = (n * n) % m;
      k /= 2;
    }
  }
  return ans;
}
void solver() {
  string s;
  cin >> s;
  long long n = s.size();
  vector<long long> dp(n + 1), pow(n + 1);
  s = ' ' + s;
  pow[0] = 1;
  for (int i = 1; i < int(n + 1); i++) {
    pow[i] = pow[i - 1] * 10;
    pow[i] %= mod;
    dp[i] = ((dp[i - 1] * 10) % mod) + (s[i] - '0');
    dp[i] %= mod;
  }
  long long ans = 0, x = 0;
  for (int i = 1; i < int(n + 1); i++) {
    ans = (ans + ((dp[n] * i) % mod)) % mod;
    ans =
        (((ans - (((i * dp[i]) % mod) * pow[n - i]) % mod) % mod) + mod) % mod;
    ans = (ans + x * pow[n - i] % mod) % mod;
    x += dp[i];
    x %= mod;
  }
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cerr.tie(0);
  long long T = 1;
  for (int i = 1; i < int(T + 1); i++) {
    solver();
  }
  return 0;
}
