#include #include typedef long long int ll; using namespace std; using namespace atcoder; struct edge { ll from; ll to; ll cost; }; typedef pair P; #define MOD 1000000007 ll dp1[100001]; ll dp2[100001]; int main() { string n; cin >> n; memset(dp1, 0, sizeof(dp1)); memset(dp2, 0, sizeof(dp2)); dp2[0] = 1; for (int i = 1; i <= n.length(); i++) { ll tmp = max(0, (n[i - 1] - '0' - 1)); dp1[i] = (dp1[i - 1] * 45 + dp2[i - 1] * tmp * (tmp + 1) / 2) % MOD; if (i >= 2) dp1[i] += 45; dp2[i] = dp2[i - 1] * (n[i - 1] - '0') % MOD; } cout << (dp1[n.length()] + dp2[n.length()]) % MOD << endl; return 0; }