#include <bits/stdc++.h>
using namespace std;
long long md = 1e9 + 7;
long long f_pow(long long a, long long b) {
  long long res = 1, temp = a;
  while (b) {
    if (b & 1) res = res * temp % md;
    temp = temp * temp % md;
    b >>= 1;
  }
  return res;
}
int main() {
  long long arr[123457];
  arr[0] = 0;
  for (int i = 0; i < 123456; i++) {
    arr[i + 1] = ((((i + 1) * f_pow(10, i)) % md) + arr[i]) % md;
  }
  string n;
  cin >> n;
  long long m = n.length();
  long long r = 0;
  for (long long i = 0; i < m; i++) {
    long long left_position = (((i + 1) * i) / 2) % md;
    r = (r + (left_position * (n[i] - '0') * f_pow(10, (m - (i + 1))))) % md;
    r = (r + ((arr[m - i - 1]) * (n[i] - '0')) % md) % md;
  }
  cout << r << endl;
  return 0;
}
