#include <bits/stdc++.h>
using namespace std;
const int mod = 1000 * 1000 * 1000 + 7;
int main() {
  string s;
  cin >> s;
  int n = s.size();
  vector<long long> dp(n + 1, 0), pre(n + 1, 0);
  long long ans = 0;
  pre[0] = 1;
  dp[0] = 0;
  for (int i = 1; i <= n; ++i) pre[i] = (pre[i - 1] * 10) % mod;
  for (int i = 1; i <= n; ++i) dp[i] = (dp[i - 1] + i * pre[i - 1]) % mod;
  for (int i = n - 1; i >= 0; --i) {
    long long val =
        (s[i] - '0') *
        (((((1LL * i * (i + 1) / 2)) % mod) * pre[n - i - 1]) % mod +
         dp[n - i - 1]);
    ans = (ans +
           (s[i] - '0') *
               ((((((1LL * i * (i + 1) / 2)) % mod) * pre[n - i - 1]) % mod +
                 dp[n - i - 1] + mod) %
                mod)) %
          mod;
  }
  cout << ans << "\n";
}
