#include <bits/stdc++.h>
using namespace std;
using int64 = long long;
void DBG() { cerr << "]" << '\n'; }
template <class H, class... T>
void DBG(H h, T... t) {
  cerr << h;
  if (sizeof...(t)) cerr << ", ";
  DBG(t...);
}
const int MOD = (int)1e9 + 7;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  string a;
  cin >> a;
  int n = a.size();
  vector<int64> pw(n), s(n);
  pw[0] = 1;
  s[0] = 0;
  for (int i = 1; i < n; i++) {
    pw[i] = 10LL * pw[i - 1] % MOD;
    int64 v = pw[i - 1] * i % MOD;
    s[i] = (s[i - 1] + v) % MOD;
  }
  int64 ans = 0;
  for (int i = 0; i < n; i++) {
    int d = a[i] - '0';
    int p = n - i - 1;
    int64 v = (1LL * i * (i + 1) / 2LL) % MOD;
    v = v * pw[p] % MOD;
    v = (v + s[p]) % MOD;
    v = v * d % MOD;
    ans = (ans + v) % MOD;
  }
  cout << ans << '\n';
  return 0;
}
