#include <bits/stdc++.h>
using namespace std;
const long long p = 1e9 + 7;
char s[500010];
long long ans, n, i, sum, fac[500010], a[500010], f[500010][2];
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  for (i = 1; i <= n / 2; i++) swap(s[i], s[n - i + 1]);
  f[1][0] = 10;
  f[1][1] = 1;
  fac[0] = 1;
  for (i = 1; i <= n; i++) fac[i] = fac[i - 1] * 10 % p, a[i] = s[i] - '0';
  sum = a[1];
  for (i = 2; i <= n; i++) {
    ans = (ans + (f[i - 1][0] - fac[i - 1] + p + f[i - 1][1]) % p * a[i]) % p;
    f[i][0] = (f[i - 1][0] * 10 + f[i - 1][1] * 10) % p;
    f[i][1] = (f[i - 1][1] + fac[i - 1]) % p;
    ans = (ans + sum * (n - i + 1)) % p;
    sum = (sum + a[i] * fac[i - 1]) % p;
  }
  printf("%lld", ans);
}
