#include #include #include using namespace std; using mint=atcoder::modint1000000007; mint dp[2][2][2][24]; mint f(string A) { int now=0; for(int j=0;j<2;j++)for(int k=0;k<2;k++)for(int l=0;l<24;l++)dp[now][j][k][l]=0; dp[now][0][0][0]=1; for(char c:A) { int nxt=1-now; for(int j=0;j<2;j++)for(int k=0;k<2;k++)for(int l=0;l<24;l++)dp[nxt][j][k][l]=0; for(int j=0;j<2;j++) { int lim=j?9:c-'0'; for(int K=0;K<2;K++)for(int k=0;k<24;k++)for(int l=0;l<=lim;l++) { dp[nxt][j||l>A>>B; for(int i=A.size();i--;) { if(A[i]=='0')A[i]='9'; else { A[i]--; break; } } cout<<(f(B)-f(A)).val()<