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