package main import . "fmt" import . "os" import bf "bufio" import . "math/big" func main() { rd:=bf.NewReader(Stdin) wr:=bf.NewWriter(Stdout) var t int Fscan(rd,&t) one:=NewInt(1) ten:=NewInt(10) mod:=NewInt(998244353) x,y,z:=new(Int),new(Int),new(Int) for ;t>0;t--{ var n,m int64 Fscan(rd,&n,&m) z.Exp(ten,z.SetInt64(n),mod) z.Add(z,mod).Sub(z,one).Mod(z,mod) if n>m { x.Exp(ten,x.SetInt64(m),mod) x.Add(x,one).Mod(x,mod) y.Exp(ten,y.SetInt64(n-m),mod) x.Mul(x,y).Mod(x,mod).Add(x,mod) z.Sub(x,z).Mod(z,mod) } Fprintln(wr,z) } wr.Flush() }