#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 7;
const int K = 2005;
const int M = 2 * N;
const int maxn = 4e5 + 7;
const int lim = 1e6;
const int MOD = 1e9 + 7;
const long long INF = 1e18;
const int P = 998244353, G = 3, Gi = 332748118;
const double eps = 1e-10;
const double PI = acos(-1);
const long long xxf = 1e18;
multiset<long long> ms;
priority_queue<int> pq1, pq2;
void blue() { std::ios::sync_with_stdio(false), cin.tie(0), cout.tie(0); }
char s[N];
long long a[N], b[N];
void init(int n) {
  a[1] = 1;
  a[0] = 0;
  long long aa = 10;
  for (long long i = 2; i <= n; i++)
    a[i] = 1ll * aa * i % MOD, aa = 1ll * aa * 10 % MOD;
  for (int i = 2; i <= n; i++) a[i] += a[i - 1];
  b[0] = 1;
  for (long long i = 1; i <= n; i++) b[i] = (b[i - 1] * 10) % MOD;
}
long long ans = 0;
int main() {
  init(10);
  scanf("%s", s + 1);
  int n = strlen(s + 1);
  init(n);
  for (int i = 1; i <= n; i++) {
    long long aa = s[i] - '0', cat = 1ll * i * (i - 1) / 2;
    long long tmp = aa * b[n - i] % MOD * cat % MOD + aa * a[n - i] % MOD;
    ans = (ans + tmp) % MOD;
  }
  printf("%lld\n", ans);
  return 0;
}
