#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long power(long long x, long long y) {
  long long ans = 1;
  x %= mod;
  while (y > 0) {
    if (y & 1) ans = (ans * x) % mod;
    x = (x * x) % mod;
    y = y >> 1;
  }
  return ans;
}
void solve(long long cas) {
  string s;
  cin >> s;
  long long n = s.size();
  vector<long long> ans(n, 0);
  long long res = 0;
  for (long long i = 0; i < n; i++) {
    long long val =
        (((i * (i + 1)) / 2) % mod * power(10, n - i - 1) % mod) % mod;
    ans[i] = ((s[i] - '0') * val) % mod;
  }
  long long tmp = 0;
  for (long long i = n - 1; i >= 0; i--) {
    long long val = (power(10, n - i - 2) * (n - i - 1)) % mod;
    tmp = (tmp + val + mod) % mod;
    ans[i] = (ans[i] + ((s[i] - '0') * tmp) % mod) % mod;
    ans[i] = (ans[i] + mod) % mod;
    res = (res + ans[i]) % mod;
  }
  cout << (res + mod) % mod << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long qu = 1;
  for (long long cas = 1; cas <= qu; cas++) {
    solve(cas);
  }
}
