#include <bits/stdc++.h>
using namespace std;
const int MOD = (int)7 + (int)1e9;
const int N = 1000005;
const double PI = 4 * atan(1);
const double eps = 1e-10;
const long long oo = 1e10;
const int K = 26;
long long mul(long long u, long long v, long long mod = MOD) {
  return ((u % mod) * (v % mod)) % mod;
}
long long add(long long u, long long v, long long mod = MOD) {
  return ((u % mod) + (v % mod) + mod) % mod;
}
long long sub(long long u, long long v, long long mod = MOD) {
  return ((u % mod) - (v % mod) + mod) % mod;
}
long long powe(long long u, long long v, long long mod = MOD) {
  long long ans = 1;
  long long acc = u;
  while (v) {
    if (v % 2) {
      ans = mul(ans, acc, mod);
    }
    acc = mul(acc, acc, mod);
    v /= 2;
  }
  return ans;
}
long long inv(long long u, long long mod = MOD) {
  return powe(u, mod - 2, mod);
}
string n;
int m;
long long inv10;
long long other[N];
long long dpu[N];
long long dpd[N];
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  reverse((n).begin(), (n).end());
  m = n.size();
  inv10 = inv(10);
  long long cur = inv10;
  long long sum = 0;
  dpd[0] = dpu[0] = 1;
  for (long long i = 1; i <= m + 1; i++) {
    if (i == 0) {
      other[i] = 0;
    } else {
      other[i] = add(other[i - 1], mul(i, cur));
    }
    dpu[i] = 1 + (i) * (i + 1) - (i * (i + 1)) / 2;
    dpu[i] = add(dpu[i], 0);
    sum += cur;
    dpd[i] = (1 + sub(mul(i + 1, sum), other[i])) % MOD;
    cur = mul(cur, inv10);
  }
  long long ans = 0;
  sum = 0;
  cur = 1;
  for (int i = 0; i < m; i++) {
    int dig = n[i] - '0';
    long long valdig = mul(dig, cur);
    sum = add(sum, valdig);
    ans = add(ans, mul(valdig, dpd[i]));
    ans = add(ans, mul(valdig, dpu[m - 1 - i]));
    ans = sub(ans, valdig);
    cur = mul(cur, 10);
  }
  ans = sub(ans, sum);
  cout << ans;
  return 0;
}
