#include <bits/stdc++.h>
using namespace std;
long long mulmod(long long a, long long b) {
  a *= b;
  a %= 1000000007;
  return a;
}
long long addmod(long long a, long long b) {
  long long c = (a + b) % 1000000007;
  return c;
}
int main() {
  long long n;
  string s;
  cin >> s;
  n = s.length();
  if (n == 1) {
    cout << 0 << endl;
    return 0;
  }
  if (n == 2) {
    cout << (s[0] - '0') + (s[1] - '0') << endl;
    return 0;
  }
  long long tens[n], sumtens[n], pref[n], suff[n], prefsum[n], suffsum[n];
  tens[0] = 1;
  sumtens[0] = 0;
  for (int i = 1; i < n; i++) {
    tens[i] = mulmod(tens[i - 1], 10);
    sumtens[i] = addmod(sumtens[i - 1], tens[i]);
  }
  pref[0] = (s[0] - '0'), suff[n - 1] = (s[n - 1] - '0');
  prefsum[0] = pref[0], suffsum[n - 1] = suff[n - 1];
  for (int i = 1; i < n; i++) {
    pref[i] = addmod(mulmod(pref[i - 1], 10), (s[i] - '0'));
    prefsum[i] = addmod(prefsum[i - 1], pref[i]);
  }
  long long p = 10;
  for (int i = n - 2; i >= 0; i--) {
    suff[i] = addmod(mulmod((s[i] - '0'), p), suff[i + 1]);
    suffsum[i] = addmod(suffsum[i + 1], suff[i]);
    p = mulmod(p, 10);
  }
  long long ans = 0;
  ans = addmod(ans, suffsum[1]);
  ans = addmod(ans, prefsum[n - 2]);
  for (int i = 1; i < n - 1; i++) {
    long long temp = mulmod(pref[i - 1], sumtens[n - i - 1]);
    temp = addmod(temp, suffsum[i + 1]);
    ans = addmod(ans, temp);
  }
  cout << ans << endl;
  return 0;
}
