#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
using namespace std;
template <class T1, class T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
  os << "{" << p.first << "," << p.second << "}";
  return os;
}
const int N = 3e5 + 5;
const long long oo = 1e9 + 7;
long long val[N];
long long p[N];
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  int n = s.size();
  s = "0" + s;
  long long pw = 1;
  for (int i = n; i >= 1; i--) {
    p[i] = pw;
    val[i] = (val[i + 1] + pw * (s[i] - '0') % oo) % oo;
    pw = pw * 10 % oo;
  }
  long long qsum = 0, qsumsum = 0, ans = 0;
  for (int i = 1; i <= n; i++) {
    ans = (ans + qsumsum * p[i] % oo + val[i + 1] * (i) % oo) % oo;
    qsum = (qsum * 10 + s[i] - '0') % oo;
    qsumsum = (qsumsum + qsum) % oo;
  }
  cout << ans << "\n";
}
