#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  cin >> str;
  long long n = str.length();
  vector<long long> pref(n + 1, 0), ps(n + 1, 0);
  for (int i = 1; i < n + 1; i++) {
    pref[i] = (pref[i - 1] * 10 + (str[i - 1] - '0')) % 1000000007;
    ps[i] = (ps[i - 1] + pref[i]) % 1000000007;
  }
  long long sum = 0;
  long long pw = 1;
  long long var = 0;
  for (int i = 0; i < n; i++) {
    sum = (sum + (ps[n - i - 1] * pw) % 1000000007 +
           (var * (n - i)) % 1000000007) %
          1000000007;
    var = (var + ((str[n - i - 1] - '0') * pw) % 1000000007) % 1000000007;
    pw = (pw * 10) % 1000000007;
  }
  cout << sum << endl;
  return 0;
}
