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