#include "testlib.h" #include #include #include using u64 = unsigned long long int; const int MIN_LEN = 1; const int MAX_LEN = 100000 + 1; int main(int argc, char** argv) { registerValidation(argc, argv); const std::string s = inf.readToken(); inf.readEoln(); inf.readEof(); assert(MIN_LEN <= s.size() && s.size() <= MAX_LEN); assert('1' <= s[0] && s[0] <= '9'); for (int i = 1; i < s.size(); ++i) { assert('0' <= s[i] && s[i] <= '9'); } if (s.size() == MAX_LEN) { for (int i = 1; i < s.size(); ++i) { assert('0' == s[i]); } } const u64 MOD = 1000000007; u64 dp = 0; u64 sup = 1; for (int i = 0; i < s.size(); ++i) { dp = 45 * dp % MOD; int k = s[i] - '0'; for (int i = 0; i < k; ++i) { dp = (dp + sup * i) % MOD; } sup = sup * k % MOD; if (i > 0) { dp = (dp + 45) % MOD; } } u64 ans = (dp + sup) % MOD; std::cout << ans << std::endl; return 0; }