#include <bits/stdc++.h>
using namespace std;
long long MOD = 1e9 + 7;
int main() {
  string s;
  cin >> s;
  vector<long long> v(s.size() + 2, 0);
  vector<long long> pt(s.size() + 2, 0);
  long long curr = 1;
  long long t = 1;
  for (int i = 1; i < v.size(); i++) {
    v[i] = (curr * t) % MOD;
    t++;
    curr *= 10;
    t %= MOD;
    curr %= MOD;
    v[i] += v[i - 1];
    v[i] %= MOD;
  }
  t = 1;
  for (int i = 0; i < pt.size(); i++) {
    pt[i] = t;
    t *= 10;
    t %= MOD;
  }
  long long ans = 0;
  for (long long i = 0; i < s.size(); i++) {
    long long x = (i + 1) * (i) / 2;
    x %= MOD;
    ans += (s[i] - '0') * (((pt[s.size() - i - 1]) * x) % MOD);
    ans %= MOD;
    ans += (s[i] - '0') * (v[s.size() - i - 1]);
    ans %= MOD;
  }
  cout << ans;
}
