#include <bits/stdc++.h>
using namespace std;
long long int n, m;
long long int arr[300][300];
long long int brr[30000];
string st;
long long int fastpower(long long int x, unsigned long long int y,
                        long long int p) {
  long long int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long int comb(long long int a) { return a * (a + 1) / 2; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int TESTS, q, a, b, l, r, c, k, p, h, w, d, x, y, z, xs, ys, t, f;
  TESTS = 1;
  while (TESTS--) {
    cin >> st;
    n = st.size();
    m = n - 1;
    m--;
    long long int cur = 0;
    long long int ans = 0;
    for (long long int i = 0; i <= n - 1; i++) {
      if (m < 0) {
        m = 0;
        cur = 0;
      }
      cur += (st[i] - '0');
      cur %= 1000000007;
      ans = (ans + ((((n - 1 - i) * cur) % 1000000007) *
                    fastpower(10, m, 1000000007)) %
                       1000000007) %
            1000000007;
      ans = (ans + (((comb(i) * (st[i] - '0')) % 1000000007) *
                    fastpower(10, n - 1 - i, 1000000007)) %
                       1000000007) %
            1000000007;
      m--;
    }
    cout << ans;
  }
  return 0;
}
