#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10, mod = 1e9 + 7;
char str[N];
long long a[10][N], sum[N], pre[10][N];
int main() {
  for (int i = 1; i <= 9; i++) {
    a[i][1] = i;
    for (int j = 2; j <= 1e5 + 5; j++) {
      a[i][j] = ((long long)a[i][j - 1] * 10) % mod;
    }
  }
  for (int i = 1; i <= 9; i++)
    for (int j = 1; j <= 1e5 + 5; j++)
      pre[i][j] = ((long long)a[i][j] * j + pre[i][j - 1]) % mod;
  sum[0] = 0;
  for (int i = 1; i <= 1e5 + 5; i++) sum[i] = (sum[i - 1] + i) % mod;
  scanf("%s", str + 1);
  reverse(str + 1, str + 1 + strlen(str + 1));
  long long res = 0;
  for (int i = 1; i <= strlen(str + 1); i++) {
    int t = str[i] - '0';
    int temp = sum[strlen(str + 1) - i];
    res = (res + pre[t][i - 1] + (long long)a[t][i] * temp % mod) % mod;
  }
  printf("%lld", res);
  ;
  ;
  ;
  ;
  ;
  ;
  return 0;
}
