#include <bits/stdc++.h>
using namespace std;
long long const MOD = 1e9 + 7;
long long d(char c) { return c - '0'; }
int main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  string s;
  cin >> s;
  s = "#" + s;
  long long ans = 0;
  long long cp = 1;
  vector<long long> pre(s.size());
  for (int i = 1; i < s.size(); i++) {
    pre[i] = pre[i - 1] + (i * cp) % MOD;
    pre[i] %= MOD;
    cp *= 10;
    cp %= MOD;
  }
  cp = 1;
  for (int i = s.size() - 1; i >= 1; i--) {
    long long f = ((long long)i * ((long long)i - 1)) / 2;
    f %= MOD;
    f *= cp;
    f %= MOD;
    f *= d(s[i]);
    f %= MOD;
    ans += f;
    ans %= MOD;
    ans += pre[s.size() - i - 1] * d(s[i]);
    ans %= MOD;
    cp *= 10;
    cp %= MOD;
  }
  cout << ans << '\n';
  return 0;
}
