#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
const double PI = acos(-1.0);
template <typename T>
inline T sq(T a) {
  return a * a;
}
template <typename T1, typename T2>
inline pair<T1, T2> mp(T1 a, T2 b) {
  return make_pair(a, b);
}
template <typename T1, typename T2>
inline T1 safeMod(T1 a, T2 m) {
  return (a % m + m) % m;
}
template <typename T1, typename T2>
inline bool isEq(T1 a, T2 b) {
  return abs(a - b) < EPS;
}
template <typename T1, typename T2, typename T3>
inline bool isEq(T1 a, T2 b, T3 eps) {
  return abs(a - b) < eps;
}
template <typename T>
inline bool isKthBitOn(T n, int k) {
  assert(n <= numeric_limits<T>::max());
  assert(k <= numeric_limits<T>::digits);
  T ONE = 1;
  return bool((n & (ONE << k)));
}
template <typename T>
inline void setKthBit(T& n, int k) {
  assert(n <= numeric_limits<T>::max());
  assert(k <= numeric_limits<T>::digits);
  T ONE = 1;
  n = (n | (ONE << k));
}
const int oo = 0x3f3f3f3f;
const int MAX = 200010;
const int MOD = 1000000007;
const int precision = 10;
long long precalc[MAX][10];
long long p10s[MAX];
void solve(int kas) {
  string s;
  cin >> s;
  int n = s.size();
  long long num = 0;
  long long p10 = 1;
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j < 10; j++) {
      if (i)
        precalc[i][j] =
            (precalc[i - 1][j] + (i + 1) * p10 % MOD * j % MOD) % MOD;
      else
        precalc[i][j] = j;
    }
    p10s[i] = p10;
    p10 = p10 * 10 % MOD;
  }
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    long long pp = (i + 1) * (i + 2) / 2 - i;
    pp %= MOD;
    ans = (ans + p10s[n - i - 1] * (s[i] - '0') % MOD * pp % MOD) % MOD;
    if (n - i - 2 >= 0)
      ans = (ans + precalc[n - i - 2][s[i] - '0'] % MOD) % MOD;
    num = (num * 10 % MOD + s[i] - '0') % MOD;
  }
  cout << (ans - num + MOD) % MOD << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int tc = 1;
  for (int _ = 1; _ <= tc; _++) {
    solve(_);
  }
  return 0;
}
