{ll n,c[9];rd(n,c(9));CombC;Mint x=10,m=sum[i,0,9]((i+1)*c[i])*C.fac(n-1)*(x**n-1)/9;m/=C.fac(c[0..8]);wt(m);}