#include <bits/stdc++.h>
using namespace std;
const long long int m = 1000000007;
int main() {
  string s;
  cin >> s;
  long long int n = s.size();
  long long int pref[n], suf[n], suf_sum[n], pref_sum[n], ten[n], ten_sum[n];
  pref[0] = s[0] - '0';
  pref_sum[0] = pref[0];
  ten[0] = 1;
  long long int ans = 0;
  for (int i = 1; i < n; i++) {
    ans = (ans + pref[i - 1]) % m;
    pref[i] = (pref[i - 1] * 10) % m + (s[i] - '0');
    pref_sum[i] = (pref_sum[i - 1] + pref[i]) % m;
    if (i == 1) {
      ten[i] = 10;
    } else
      ten[i] = (ten[i - 1] * 10) % m;
  }
  suf[n - 1] = s[n - 1] - '0';
  suf_sum[n - 1] = suf[n - 1];
  ten_sum[0] = 0;
  for (int i = n - 2, j = 1; i >= 0; i--, j++) {
    ans = (ans + suf[i + 1]) % m;
    suf[i] = ((s[i] - '0') * ten[j] + suf[i + 1]) % m;
    suf_sum[i] = (suf_sum[i + 1] + suf[i]) % m;
    ten_sum[j] = (ten_sum[j - 1] + ten[j]) % m;
  }
  for (int i = 1; i < n - 1; i++) {
    ans = (ans + pref[i - 1] * ten_sum[n - (i + 1)] + suf_sum[i + 1]) % m;
  }
  cout << ans << endl;
}
