#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long int n = s.length();
  long long int front[n];
  long long int factor = 1;
  front[0] = 0;
  long long int ten_raise_to_power[n];
  ten_raise_to_power[0] = 1;
  for (long long int i = 1; i < n; i++, factor = (factor * 10) % 1000000007) {
    front[i] = (front[i - 1] + ((i * factor) % 1000000007)) % 1000000007;
    ten_raise_to_power[i] = (factor * 10) % 1000000007;
  }
  long long int ans = 0;
  for (long long int i = 0; i < n; i++) {
    long long int numbers_in_front = n - (i + 1);
    long long int numbers_in_back = i;
    long long int digit = s[i] - '0';
    long long int front_value =
        ((s[i] - '0') * front[numbers_in_front]) % 1000000007;
    long long int number_of_back_substrings =
        (((numbers_in_back * (numbers_in_back + 1))) / 2) % 1000000007;
    long long int back_value =
        (((number_of_back_substrings * (s[i] - '0')) % 1000000007) *
         ten_raise_to_power[numbers_in_front]) %
        1000000007;
    ans = (ans + front_value + back_value) % 1000000007;
  }
  cout << ans << endl;
  return 0;
}
