#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
char a[100007];
int b[100007];
int main() {
  scanf("%s", a);
  long long ans = 0;
  long long tmp = 0;
  int i = 0;
  for (; a[i]; i++) {
    tmp += i;
    tmp %= MOD;
    b[i] = tmp * (a[i] - '0') % MOD;
  }
  tmp = 0;
  long long tt = 0;
  long long t10 = 1;
  long long z = 0;
  for (i--; i >= 0; i--) {
    ans += b[i] * t10 % MOD;
    ans += (a[i] - '0') * tt % MOD;
    ans %= MOD;
    z++;
    tt += z * t10;
    t10 *= 10;
    t10 %= MOD;
    tt %= MOD;
  }
  printf("%lld\n", ans);
}
