#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const int p = 1e9 + 7;
long long qpow(long long a, long long n) {
  long long res = 1;
  while (n) {
    if (n & 1) res = res * a % p;
    a = a * a % p;
    n >>= 1;
  }
  return res;
}
char a[N];
int b[N];
long long pre[N];
void work() {
  scanf("%s", a + 1);
  int n = strlen(a + 1);
  for (int i = 1; i <= n; i++) {
    b[i] = a[i] - '0';
  }
  long long ans = 0;
  pre[0] = 0;
  for (int i = 1; i <= n; i++) {
    pre[i] = (pre[i - 1] + i * qpow(10, i - 1)) % p;
  }
  for (int i = 1; i <= n; i++) {
    ans = ans + b[i] * pre[n - i] % p +
          1ll * b[i] * (i) % p * (i - 1) % p * qpow(2, p - 2) % p *
              qpow(10, n - i) % p;
    ans %= p;
  }
  printf("%lld\n", ans);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int T = 1;
  while (T--) {
    work();
  }
}
