#include <bits/stdc++.h>
using namespace std;
const long long N = (long long)2e5 + 5;
const long long mod = (long long)1e9 + 7;
long long pre[N], suf[N], lt[N], n;
string s;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  n = s.size();
  s = " " + s;
  lt[0] = 1;
  for (long long i = 1; i <= n; i++) {
    lt[i] = (lt[i - 1] * 10) % mod;
  }
  long long dem = 0;
  for (long long i = 1; i <= n; i++) {
    dem = (dem * 10 + s[i] - '0') % mod;
    pre[i] = (dem + pre[i - 1]) % mod;
  }
  dem = 0;
  for (long long i = n; i >= 1; i--) {
    dem = (dem + (s[i] - '0') * lt[n - i]) % mod;
    suf[i] = dem;
  }
  long long res = 0;
  for (long long i = 1; i <= n; i++) {
    res = (res + pre[i - 1] * lt[n - i] + suf[i + 1] * i) % mod;
  }
  cout << res;
}
