#include <bits/stdc++.h>
using namespace std;
const long long int maxn = 100005;
long long int p10[maxn];
const long long int MOD = 1000 * 1000 * 1000 + 7;
long long int ans;
long long int dp[maxn];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  long long int n = s.size();
  long long int digit[n];
  for (long long int i = 0; i < n; i++) {
    digit[i] = s[n - 1 - i] - 48;
  }
  p10[0] = 1;
  for (long long int i = 1; i < maxn; i++) {
    p10[i] = p10[i - 1] * 10;
    p10[i] %= MOD;
  }
  for (long long int i = 0; i < n; i++) {
    long long int v1 = n - i - 1;
    v1 *= v1 + 1;
    v1 /= 2;
    v1 %= MOD;
    v1 *= p10[i];
    v1 %= MOD;
    v1 *= digit[i];
    v1 %= MOD;
    ans += v1;
    ans %= MOD;
  }
  for (long long int i = 0; i < n; i++) {
    dp[0] += digit[i];
    dp[i] -= digit[i];
    dp[0] %= MOD;
    dp[i] %= MOD;
  }
  for (long long int i = 1; i < n; i++) {
    dp[i] += dp[i - 1];
    dp[i] %= MOD;
  }
  for (long long int i = 0; i < n; i++) {
    dp[i] -= i * digit[i];
    dp[i] %= MOD;
  }
  for (long long int i = 1; i < n; i++) {
    dp[i] += dp[i - 1];
    dp[i] %= MOD;
  }
  for (long long int i = 0; i < n; i++) {
    long long int v2 = p10[i] * dp[i];
    v2 %= MOD;
    ans += v2;
    ans %= MOD;
  }
  if (ans < 0) {
    ans += MOD;
  }
  cout << ans;
  return 0;
}
