#include #define rep(i,n) for(int i = 0; i < (int)(n); i++) #define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--) #define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++) #define rrep2(ri,x,n) for(int ri = (int)(n-1); ri >= (int)(x); ri--) #define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++) #define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++) #define ALL(x) x.begin(), x.end() using ll = long long; using namespace std; #include using namespace atcoder; using mint = modint1000000007; int main() { string s; cin >> s; mint ans = 0; auto c2i = [](char c) { return c - '0'; }; mint pw = 1; rrep(i, s.size()-1) { pw *= 10*9/2; ans += pw; } mint p = 1, m = 45; rep(i, s.size()) { int now = c2i(s.at(i)); ans += p*((now)*(now-1)/2)*m.pow(s.size()-i-1); p *= now; } // int l = c2i(s.back()); // ans += p*(l*(l+1)/2); cout << ans.val() << endl; return 0; }