#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  string s;
  cin >> s;
  long long n = s.length();
  long long a[n];
  for (long long i = 0; i < n; i++) a[i] = s[i] - '0';
  long long ans = 0;
  long long sum = a[0] % 1000000007;
  long long p10[n + 1];
  p10[0] = 1;
  for (long long i = 1; i <= n; i++) p10[i] = (p10[i - 1] * 10) % 1000000007;
  for (long long i = 2; i < n + 1; i++) {
    long long mul = p10[n - i];
    mul *= (n - (i - 1));
    mul %= 1000000007;
    mul *= sum;
    mul %= 1000000007;
    ans += mul;
    ans %= 1000000007;
    sum += a[i - 1];
    sum %= 1000000007;
  }
  for (long long i = 1; i < n; i++) {
    long long mul = i * (i + 1);
    mul /= 2;
    long long umm = a[i] * p10[n - 1 - i];
    umm %= 1000000007;
    mul %= 1000000007;
    umm *= mul;
    umm %= 1000000007;
    ans += umm;
    ans %= 1000000007;
  }
  cout << ans;
  return 0;
}
