#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const long double PI = acos((long double)-1);
long long f(long long n) { return ((n * (n - 1)) / 2) % MOD; }
void solve() {
  string str;
  cin >> str;
  reverse((str).begin(), (str).end());
  long long x = 0;
  long long ans = 0;
  long long power = 1;
  long long n = str.length();
  for (long long i = 0; i < n; ++i) {
    long long digit = str[i] - '0';
    ans = (ans + (f(n - i) * power % MOD + x) % MOD * digit % MOD) % MOD;
    x = (x + power * (i + 1)) % MOD;
    power = (power * 10) % MOD;
  }
  cout << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
