#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
long long binExp(long long a, long long b) {
  a %= mod;
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  int n = s.length();
  long long ans = 0;
  long long powArr[n + 1];
  long long rightAddendum[n + 1];
  for (int i = 0; i < n; i++) {
    powArr[i] = binExp(10, i);
  }
  rightAddendum[0] = 0;
  rightAddendum[1] = 1;
  for (int i = 2; i < n; i++) {
    rightAddendum[i] = (((i % mod) * (powArr[i - 1] % mod) % mod) +
                        rightAddendum[i - 1] % mod) %
                       mod;
  }
  for (int i = 0; i < n; i++) {
    long long ele = s[i] - '0';
    long long leftRem = (binExp(10, n - i - 1));
    int digAfter = n - i - 1;
    long long rightRem = rightAddendum[digAfter] % mod;
    long long temp = (((long long)i * (i + 1)) / 2) % mod;
    leftRem = (leftRem % mod * temp % mod) % mod;
    ans += ((((rightRem % mod) + (leftRem % mod)) % mod) * ele) % mod;
  }
  cout << ans % mod << endl;
}
