#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9, mod = 1e9 + 7;
int main() {
  string num;
  cin >> num;
  reverse(num.begin(), num.end());
  int n = num.size();
  vector<long long> pw10(n + 1);
  pw10[0] = 1;
  for (int i = 1; i <= n; i++) {
    pw10[i] = pw10[i - 1] * 10 % mod;
  }
  long long ans = 0;
  long long d = 0;
  for (int i = 0; i < n; i++) {
    ans += ((long long)(n - i) * (n - i - 1) / 2) % mod * (num[i] - '0') % mod *
           pw10[i] % mod;
    ans %= mod;
    if (i > 0) {
      d += i * pw10[i - 1] % mod;
      d %= mod;
      ans += d * (num[i] - '0') % mod;
      ans %= mod;
    }
  }
  cout << ans << endl;
  return 0;
}
