#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define LL long long const LL MOD = (LL)1e9 + 7; LL nine[300][2000]; string M, D; void dfs(int n,LL res[],string &s){ s[n] -= '0'; for (int i = 0; i < 1991; i++) for (int j = 0; j > M >> D; LL res1[2000] = { 0 }; LL res2[2000] = { 0 }; LL ans = 0; dfs(0, res1, M); dfs(0, res2, M); for (int i = 1; i < 2000; i++) ans = (ans + res1[i] + res2[i]) % MOD; // reverse(M.begin(), M.end()); // reverse(D.begin(), M.end()); cout << ans << endl; return(0); }