#include using namespace std; // #define int long long #define rep(i, n) for (long long i = (long long)(0); i < (long long)(n); ++i) #define reps(i, n) for (long long i = (long long)(1); i <= (long long)(n); ++i) #define rrep(i, n) for (long long i = ((long long)(n)-1); i >= 0; i--) #define rreps(i, n) for (long long i = ((long long)(n)); i > 0; i--) #define irep(i, m, n) for (long long i = (long long)(m); i < (long long)(n); ++i) #define ireps(i, m, n) for (long long i = (long long)(m); i <= (long long)(n); ++i) #define SORT(v, n) sort(v, v + n); #define REVERSE(v, n) reverse(v, v+n); #define vsort(v) sort(v.begin(), v.end()); #define all(v) v.begin(), v.end() #define mp(n, m) make_pair(n, m); #define cout(d) cout<; using vvi = vector; using vll = vector; using vvll = vector; using pii = pair; using pll = pair; using vs = vector; using vpll = vector>; using vtp = vector>; using vb = vector; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } const ll INF = 1e9; const ll MOD = 1e9+7; const ll LINF = 1e18; // 10^200 より作れる数字和は高々2000程度 ll dp[205][2][2000]; // pos, isLess, sum of digit := count vll f(string s){ ll n=s.size(); memset(dp,0,sizeof(dp)); dp[0][0][0]=1; rep(i,n) rep(j,2) rep(k,2000){ ll now=s[i]-'0'; rep(nxt,10){ if(nxt>now&&j==0) continue; ll nj=j|nxt>m>>d; auto a=f(m), b=f(d); ll ans=0; irep(i,0,2000){ (ans+=a[i]*b[i]%MOD)%=MOD; } ans=(ans-1+MOD)%MOD; cout<