#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long b) {
  if (b == 0) {
    return 1;
  }
  long long x = (power(a, b / 2));
  long long ans =
      ((long long)(x % 1000000007) * (long long)(x % 1000000007)) % 1000000007;
  if (b % 2 != 0)
    ans = (long long)(ans % 1000000007) * (long long)(a % 1000000007);
  return ans % 1000000007;
}
int main() {
  string str;
  cin >> str;
  long long n = str.length();
  vector<long long> arr(n, 0);
  for (long long i = 0; i < n; i++) {
    arr[i] = str[i] - '0';
  }
  if (n == 1) {
    cout << 0 << endl;
    return 0;
  }
  vector<long long> pre(n, 0);
  long long curr;
  for (long long i = 0; i < n; i++) {
    if (i == 0) {
      curr = arr[0];
      pre[0] = curr;
      curr = (long long)curr * (long long)10;
      curr = curr % 1000000007;
      continue;
    }
    curr += arr[i];
    curr = curr % 1000000007;
    pre[i] = curr;
    curr = ((long long)curr * (long long)10) % 1000000007;
    curr = curr % 1000000007;
  }
  vector<long long> suff(n, 0);
  long long temp = 1;
  for (long long i = n - 1; i >= 0; i--) {
    if (i == n - 1) {
      curr = arr[n - 1];
      suff[n - 1] = curr;
      temp = (long long)(temp % 1000000007) * (long long)(10 % 1000000007);
      continue;
    }
    suff[i] =
        (long long)suff[i + 1] +
        (((long long)(temp % 1000000007) * (long long)(arr[i] % 1000000007)) +
         curr);
    suff[i] = suff[i] % 1000000007;
    curr = (((long long)temp * (long long)arr[i]) % 1000000007) + curr;
    temp = ((long long)temp * (long long)10) % 1000000007;
    temp = temp % 1000000007;
  }
  long long minv = (power(9, 1000000007 - 2)) % 1000000007;
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    if (i == 0) {
      ans = (ans + suff[i + 1]) % 1000000007;
      continue;
    }
    if (i == n - 1) {
      ans = (ans + pre[i - 1]) % 1000000007;
      continue;
    }
    long long val = ((long long)((power(10, n - i) - 1) % 1000000007) *
                     ((long long)(minv % 1000000007))) %
                    1000000007;
    val = ((long long)val * (long long)pre[i - 1]) % 1000000007;
    val += suff[i + 1];
    val = val % 1000000007;
    ans = ans % 1000000007;
    ans += val;
    ans = ans % 1000000007;
  }
  cout << ans << endl;
}
