mod=998244353 t=int(input()) for _ in range(t): n,m=map(int,input().split()) a=pow(10,n)-1 b=pow(10,m)+1 print((a%b)%mod)