#include #define int ll using namespace std; #define rep(i,n) for(int i=0;i=0;i--) #define rng(i,c,n) for(int i=c;i #define _4ab8goq ios::sync_with_stdio(0),cin.tie(0); typedef long long ll; typedef vector vi; typedef pair pii; void print(){cout<<'\n';} template void print(const h&v,const t&...u){cout<>n>>m; if(n<=m){ print((binpow(10,n,mod)+mod-1)%mod); }else{ n%=(2*m); if(n<=m){ int ans=binpow(10,n,mod)-1; ans+=mod; ans%=mod; print(ans); }else{ int ans=binpow(10,m,mod); ans-=(binpow(10,n-m,mod)-1); ans+=mod; ans%=mod; print(ans); } } } signed main(){ _4ab8goq; int __t; cin>>__t; rep(cs,__t){ slv(); } }