#include <bits/stdc++.h>
using namespace std;
const long long INF = 0x3f3f3f3f;
const long long mod = 1e9 + 7;
long long p[100010];
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  long long len = s.size();
  long long f = 1;
  long long res = 0, ans = 0;
  long long cnt = 0;
  for (long long i = len - 1; i >= 0; i--) {
    cnt++;
    long long k = (i + 1) * i / 2;
    ans = (ans + (s[i] - '0') * res % mod + (s[i] - '0') * k % mod * f) % mod;
    res = (res + (cnt)*f % mod) % mod;
    f = (f * 10) % mod;
  }
  cout << ans << endl;
  return 0;
}
