#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define rep(x, to) for (int x = 0; x < (to); x++) #define REP(x, a, to) for (int x = (a); x < (to); x++) #define foreach(itr, x) for (typeof((x).begin()) itr = (x).begin(); itr != (x).end(); itr++) #define EPS (1e-14) using namespace std; typedef long long ll; typedef pair PII; typedef pair PLL; const ll MOD = 1e+9 + 9; string s, t; ll dp[205][1805][2]; ll dp2[205][1805][2]; ll ans; void solve() { dp[s.size()][0][0] = 1; dp[s.size()][0][1] = 1; for (int i = s.size() - 1; i >= 0; i--) { for (int j = 0; j <= 1800; j++) { for (int k = 0; k < 10; k++) { dp[i][j][0] += dp[i + 1][j - k][0]; dp[i][j][0] %= MOD; } for (int k = 0; k <= j && k < s[i] - '0'; k++) { dp[i][j][1] += dp[i + 1][j - k][0]; dp[i][j][1] %= MOD; } if (j - (s[i] - '0') >= 0) { dp[i][j][1] += dp[i + 1][j - (s[i] - '0')][1]; dp[i][j][1] %= MOD; } } } dp2[t.size()][0][0] = 1; dp2[t.size()][0][1] = 1; for (int i = t.size() - 1; i >= 0; i--) { for (int j = 0; j <= 1800; j++) { for (int k = 0; k < 10; k++) { dp2[i][j][0] += dp2[i + 1][j - k][0]; dp2[i][j][0] %= MOD; } for (int k = 0; k <= j && k < s[i] - '0'; k++) { dp2[i][j][1] += dp2[i + 1][j - k][0]; dp2[i][j][1] %= MOD; } if (j - (s[i] - '0') >= 0) { dp2[i][j][1] += dp2[i + 1][j - (s[i] - '0')][1]; dp2[i][j][1] %= MOD; } } } #if 0 cout << dp[0][13][1] << endl; #endif REP(i, 0, 1800 + 1) { ans += (dp[0][i][1] * dp2[0][i][1]) % MOD; ans %= MOD; } cout << ((ans-1) + MOD) % MOD << endl; } int main() { cin >> s >> t; solve(); return 0; }