#include <bits/stdc++.h>
using namespace std;
int MOD = 1e9 + 7;
const long long N = 1e5 + 10;
void solve(string s) {
  long long len = s.size();
  vector<long long> f(N, 0);
  f[0] = 1;
  f[1] = 10;
  for (long long i = 2; i < N; i++) {
    f[i] = (f[i - 1] * 10) % MOD;
  }
  long long tmp = 0;
  long long res = 0;
  reverse(s.begin(), s.end());
  for (long long i = 0; i < len; i++) {
    long long ans1 =
        (len - i) * (len - i - 1) / 2 % MOD * f[i] * (s[i] - '0') % MOD;
    long long ans2 = (s[i] - '0') * tmp % MOD;
    tmp = ((i + 1) * f[i] % MOD + tmp) % MOD;
    res += (ans1 + ans2) % MOD;
    res %= MOD;
  }
  cout << res << endl;
}
int main() {
  string num;
  cin >> num;
  ;
  solve(num);
}
