#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
double pi = 3.141592653589793238;
long long power(long long x, long long n) {
  long long res = 1;
  while (n) {
    if (n & 1) res = (res * x) % mod;
    x = (x * x) % mod;
    n >>= 1;
  }
  return res;
}
long long sum_digits(long long n) {
  long long ret = 0;
  while (n) {
    ret += n % 10;
    n /= 10;
  }
  return ret;
}
long long gcd(long long a, long long b) {
  if (a == 0)
    return b;
  else
    return gcd(b % a, a);
}
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
long long max_subarray(vector<int>& v) {
  if (v.empty()) return 0;
  long long glob = v[0], loc = v[0];
  for (int i = 1; i < v.size(); ++i) {
    loc = max(v[i] + 0LL, loc + v[i]);
    glob = max(loc, glob);
  }
  return glob;
}
long long num_digits(long long x) {
  long long ans = 0;
  while (x) {
    ++ans;
    x /= 10;
  }
  return ans == 0 ? 1 : ans;
}
vector<int> topological_sort(vector<vector<int>>& graph, int n,
                             vector<int>& indegree) {
  vector<int> ans;
  stack<int> s;
  for (int i = 0; i < n; ++i)
    if (indegree[i] == 0) s.push(i);
  while (!s.empty()) {
    int x = s.top();
    s.pop();
    ans.push_back(x);
    for (auto& adj : graph[x])
      if (--indegree[adj] == 0) s.push(adj);
  }
  return ans;
}
void UF_initialize(vector<int>& arr, vector<int>& size) {
  for (int i = 0; i < arr.size(); ++i) {
    arr[i] = i;
    size[i] = 1;
  }
}
long long UF_root(long long x, vector<int>& arr) {
  while (x != arr[x]) x = arr[x];
  return x;
}
bool UF_find(long long x, long long y, vector<int>& arr) {
  return UF_root(x, arr) == UF_root(y, arr);
}
void UF_union(vector<int>& arr, vector<int>& size, long long x, long long y) {
  long long root_x = UF_root(x, arr);
  long long root_y = UF_root(y, arr);
  if (size[root_x] < size[root_y]) {
    arr[root_x] = arr[root_y];
    size[root_y] += size[root_x];
  } else {
    arr[root_y] = arr[root_x];
    size[root_x] += size[root_y];
  }
}
long long dir[4][2] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
long long p, q;
bool valid(long long i, long long j) {
  return i >= 1 && i <= p && j >= 1 && j <= q;
}
const long long maxi = 100001;
long long pre[maxi];
int main() {
  pre[0] = 0;
  for (int i = 1; i < maxi; ++i)
    pre[i] = (pre[i - 1] + ((power(10, i - 1) * i) % mod)) % mod;
  string s;
  cin >> s;
  long long n = s.length(), left, right, ans = 0;
  for (int i = 0; i < n; ++i) {
    left = i;
    right = n - i - 1;
    ans = (ans +
           ((left * (left + 1) / 2) % mod) * (s[i] - '0') * power(10, right)) %
          mod;
    ans = (ans + (s[i] - '0') * pre[right]) % mod;
  }
  cout << ans << endl;
  return 0;
}
