#include <bits/stdc++.h>
using namespace std;
const int MOD = (int)1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  cin >> s;
  int n = s.size();
  vector<long long int> a(n);
  for (int i = 0; i < n; ++i) {
    a[i] = s[i] - '0';
  }
  long long int ans = 0;
  long long int sum = 0;
  long long int p = 1;
  for (long long int i = n - 1; i >= 0; --i) {
    long long int k = (i * (i + 1) / 2 % MOD * p % MOD + sum) % MOD;
    sum = (sum + p * (n - i) % MOD) % MOD;
    p = p * 10 % MOD;
    ans = (ans + a[i] * k % MOD) % MOD;
  }
  cout << ans << endl;
  return 0;
}
