#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long exp(long long x, long long n, long long mod) {
  long long result = 1;
  while (n) {
    if (n & 1) result = (result * x) % mod;
    x = (x * x) % mod;
    n >>= 1;
  }
  return result;
}
const long long M = 1e9 + 7;
const int N = 1e6 + 1;
vector<long long> MOD(N);
vector<long long> calc(N);
void init(int n) {
  MOD[0] = 1;
  for (int i = 1; i < n; i++) MOD[i] = (MOD[i - 1] * 10) % M;
  for (int i = 1; i < n; i++)
    calc[i] = (calc[i - 1] + (i * MOD[i - 1]) % M) % M;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  int n = s.length();
  init(n);
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    long long x = s[i] - '0', l1 = i, l2 = n - 1 - i;
    if (!x) continue;
    long long temp = ((l1 * (l1 + 1)) / 2) % M;
    ans = (ans + (x * (temp * MOD[l2]) % M) % M) % M;
    ans = (ans + (x * calc[l2]) % M) % M;
  }
  cout << ans << "\n";
  return 0;
}
