#include #include using namespace std; using i64 = long long; class range {private: struct I{int x;int operator*(){return x;}bool operator!=(I& lhs){return x f(string s) { int n = s.size(); vector>> dp(n+1, vector>(2, vector(2222))); dp[0][0][0] = 1; for(int i : range(n)) { for(int j : range(2)) { for(int x : range(2200)) { for(int d : range(j?10:s[i]-'0'+1)) { int flag = j | d < s[i] - '0'; dp[i+1][flag][x+d] += dp[i][j][x]; dp[i+1][flag][x+d] %= mod; } } } } vector res(2200); for(int i : range(2200)) { res[i] = (dp[n][0][i] + dp[n][1][i]) % mod; } --res[0]; return res; } int main(void) { string m, d; cin >> m >> d; vector r0 = f(m), r1 = f(d); i64 res = 0; for(int i : range(2200)) { res += r0[i] * r1[i] % mod; res %= mod; } printf("%d\n", int(res)); return 0; }