#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1);
const long long MOD = 1000000007;
const long long FMOD = 998244353;
long long power(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
void solve() {
  string s;
  cin >> s;
  long long n = s.size();
  vector<long long> arr(n + 1), v1(n), v2(n);
  v2[n - 1] = s[n - 1] - '0';
  for (long long i = n - 2; i >= 0; i--) {
    v2[i] = (s[i] - '0') * power(10, n - i - 1, MOD) + v2[i + 1];
    v2[i] %= MOD;
  }
  v1[0] = s[0] - '0';
  for (long long i = 1; i < n; i++) {
    v1[i] = (v1[i - 1] * 10) + (s[i] - '0');
    v1[i] %= MOD;
  }
  for (long long i = n - 2; i >= 0; i--) {
    v2[i] += v2[i + 1];
    v2[i] %= MOD;
  }
  arr[1] = 1;
  for (long long i = 2; i < n + 1; i++) {
    arr[i] = (arr[i - 1] * 10) % MOD;
  }
  for (long long i = 2; i < n + 1; i++) {
    arr[i] += arr[i - 1];
    arr[i] %= MOD;
  }
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    long long b = 0;
    if (i) {
      b = v1[i - 1];
    }
    b *= arr[n - i];
    b %= MOD;
    if (i != n - 1)
      ans += (b + v2[i + 1]);
    else {
      ans += b;
    }
    ans %= MOD;
  }
  cout << ans << endl;
}
signed main() { solve(); }
