#include using namespace std; typedef long long ll; typedef vector< int > vi; typedef vector< vi > vvi; typedef vector< ll > vl; typedef vector< vl > vvl; typedef pair< int, int > pii; typedef vector< pii > vp; typedef vector< double > vd; typedef vector< vd > vvd; typedef vector< string > vs; template< class T1, class T2 > int upmin( T1 &x, T2 v ){ if( x > v ){ x = v; return 1; } return 0; } template< class T1, class T2 > int upmax( T1 &x, T2 v ){ if( x < v ){ x = v; return 1; } return 0; } const int INF = 0x3f3f3f3f; const int MOD9 = ( int ) 1e9 + 9; string M, D; void init(){ cin >> M >> D; } int dpm[ 200 + 1 ][ 9 * 200 + 1 ][ 2 ]; int dpd[ 200 + 1 ][ 9 * 200 + 1 ][ 2 ]; void preprocess(){ dpm[ 0 ][ 0 ][ 0 ] = dpd[ 0 ][ 0 ][ 0 ] = 1; for( int i = 0; i < M.size(); ++i ) for( int j = 0; j <= 9 * i; ++j ) for( int k = 0; k < 2; ++k ) for( int d = 0; d <= ( k ? 9 : M[ i ] - '0' ); ++d ) ( dpm[ i + 1 ][ j + d ][ k | d < M[ i ] - '0' ] += dpm[ i ][ j ][ k ] ) %= MOD9; for( int i = 0; i < D.size(); ++i ) for( int j = 0; j <= 9 * i; ++j ) for( int k = 0; k < 2; ++k ) for( int d = 0; d <= ( k ? 9 : D[ i ] - '0' ); ++d ) ( dpd[ i + 1 ][ j + d ][ k | d < D[ i ] - '0' ] += dpd[ i ][ j ][ k ] ) %= MOD9; } void solve(){ int ans = 0; for( int i = 1; i <= 9 * min( M.size(), D.size() ); ++i ){ int x = ( dpm[ M.size() ][ i ][ 0 ] + dpm[ M.size() ][ i ][ 1 ] ) % MOD9; int y = ( dpd[ D.size() ][ i ][ 0 ] + dpd[ D.size() ][ i ][ 1 ] ) % MOD9; ( ans += 1LL * x * y % MOD9 ) %= MOD9; } cout << ans << endl; } signed main(){ ios::sync_with_stdio( 0 ); init(); preprocess(); solve(); return 0; }