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