#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int MOD = 1e9+7;
ll power(ll x,int y){
if(y == 0)
return 1;
ll res = 1;
while(y){
if(y&1)
res = (res*x)%MOD;
x = (x*x)%MOD;
y /= 2;
}
return res;
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
string s;
cin >> s;
int n = s.length();
ll ans = 0;
for(int i = 0; i < n;++i){
ll digit = s[i] - '0';
ll num_left = i;
ll num_right = n-i-1;
ll left_contribution = (num_left*(num_left+1))/2LL;
left_contribution %= MOD;
left_contribution = (left_contribution * digit)%MOD * power(10LL,n-i-1);
left_contribution %= MOD;
ll right_contribution = (power(10LL,num_right) * (9LL * num_right - 1) + 1) * digit;
right_contribution /= 81LL;
right_contribution %=MOD;
ans = (ans + right_contribution + left_contribution)%MOD;
}
cout << ans << "\n";
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKdXNpbmcgbGwgPSBsb25nIGxvbmc7CmNvbnN0IGludCBNT0QgPSAxZTkrNzsKbGwgcG93ZXIobGwgeCxpbnQgeSl7CglpZih5ID09IDApCgkJcmV0dXJuIDE7CglsbCByZXMgPSAxOwoJd2hpbGUoeSl7CgkJaWYoeSYxKQoJCQlyZXMgPSAocmVzKngpJU1PRDsKCQl4ID0gKHgqeCklTU9EOwoJCXkgLz0gMjsKCX0KCXJldHVybiByZXM7Cn0KaW50IG1haW4oKQp7Cglpb3NfYmFzZTo6c3luY193aXRoX3N0ZGlvKDApOwoJY2luLnRpZSgwKTsKCXN0cmluZyBzOwoJY2luID4+IHM7CglpbnQgbiA9IHMubGVuZ3RoKCk7CglsbCBhbnMgPSAwOwoJZm9yKGludCBpID0gMDsgaSA8IG47KytpKXsKCQlsbCBkaWdpdCA9IHNbaV0gLSAnMCc7CgkJbGwgbnVtX2xlZnQgPSBpOwoJCWxsIG51bV9yaWdodCA9IG4taS0xOwoJCWxsIGxlZnRfY29udHJpYnV0aW9uID0JKG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